Commits

Hudarsono Hu committed ccd4900

fix styling, fix markdown

Comments (0)

Files changed (74)

Binary file modified.

+syntax: glob
+
+*.elc
+*.pyc

Binary file modified.

Add a comment to this file

appengine_django/__init__.pyc

Binary file modified.

Add a comment to this file

appengine_django/db/__init__.pyc

Binary file modified.

Add a comment to this file

appengine_django/db/base.pyc

Binary file modified.

Add a comment to this file

appengine_django/db/creation.pyc

Binary file modified.

Add a comment to this file

appengine_django/mail.pyc

Binary file modified.

Add a comment to this file

appengine_django/management/__init__.pyc

Binary file modified.

Add a comment to this file

appengine_django/management/commands/__init__.pyc

Binary file modified.

Add a comment to this file

appengine_django/management/commands/startapp.pyc

Binary file modified.

Add a comment to this file

appengine_django/models.pyc

Binary file modified.

Add a comment to this file

appengine_django/replacement_imp.pyc

Binary file modified.

Add a comment to this file

appengine_django/serializer/__init__.pyc

Binary file modified.

Add a comment to this file

appengine_django/serializer/json.pyc

Binary file modified.

Add a comment to this file

appengine_django/serializer/python.pyc

Binary file modified.

Add a comment to this file

appengine_django/serializer/pyyaml.pyc

Binary file modified.

Add a comment to this file

appengine_django/sessions/backends/__init__.pyc

Binary file modified.

Binary file modified.

Add a comment to this file

context/context_processors.pyc

Binary file modified.

Add a comment to this file

gaesessions/__init__.pyc

Binary file modified.

Binary file modified.

Add a comment to this file

markdown/blockparser.pyc

Binary file modified.

Add a comment to this file

markdown/blockprocessors.pyc

Binary file modified.

Add a comment to this file

markdown/etree_loader.pyc

Binary file modified.

Add a comment to this file

markdown/extensions/__init__.pyc

Binary file modified.

Add a comment to this file

markdown/extensions/codehilite.pyc

Binary file modified.

Binary file modified.

Add a comment to this file

markdown/inlinepatterns.pyc

Binary file modified.

Binary file modified.

Add a comment to this file

markdown/postprocessors.pyc

Binary file modified.

Add a comment to this file

markdown/preprocessors.pyc

Binary file modified.

Add a comment to this file

markdown/treeprocessors.pyc

Binary file modified.

Empty file added.

media/fileform.py

+from django import forms
+
+
+class FileForm(forms.Form):
+	title = forms.CharField(required=True)
+	
+from appengine_django.models import BaseModel
+from google.appengine.ext import db
+from google.appengine.ext import blobstore
+
+# Create your models here.
+class Media(db.Model):
+	title = db.StringProperty()
+	created = db.DateTimeProperty(auto_now_add=True)
+	media = blobstore.BlobReferenceProperty()
+	
+# Create your views here.
+from django.http import HttpResponseRedirect, Http404, HttpResponse
+from django.shortcuts import render_to_response
+from google.appengine.ext import blobstore
+import cgi
+from models import Media
+from fileform import FileForm
+
+
+def get_uploads(request, field_name=None, populate_post=False):
+    """Get uploads sent to this handler.
+    Args:
+      field_name: Only select uploads that were sent as a specific field.
+      populate_post: Add the non blob fields to request.POST
+    Returns:
+      A list of BlobInfo records corresponding to each upload.
+      Empty list if there are no blob-info records for field_name.
+    """
+    
+    if hasattr(request,'__uploads') == False:
+        request.META['wsgi.input'].seek(0)
+        fields = cgi.FieldStorage(request.META['wsgi.input'], environ=request.META)
+        
+        request.__uploads = {}
+        if populate_post:
+            request.POST = {}
+        
+        for key in fields.keys():
+            field = fields[key]
+            if isinstance(field, cgi.FieldStorage) and 'blob-key' in field.type_options:
+                request.__uploads.setdefault(key, []).append(blobstore.parse_blob_info(field))
+            elif populate_post:
+                request.POST[key] = field.value
+    if field_name:
+        try:
+            return list(request.__uploads[field_name])
+        except KeyError:
+            return []
+    else:
+        results = []
+        for uploads in request.__uploads.itervalues():
+            results += uploads
+        return results
+
+
+def upload(request):
+	form = None
+	if request.method =='POST':
+		media_blobs = get_uploads(request, field_name='media', populate_post=True)
+		form = FileForm(request.POST)
+		if form.is_valid() and len(media_blobs) == 1:
+			media_item = Media(name=form.cleaned_data['name'],
+								media=media_blobs[0])
+			media_item.put()
+			return HttpResponse('success')
+		
+		if len(media_blobs) == 0:
+			request.session['upload_error'] = "Media file is required"
+		
+		form = FileForm(request.POST)
+            
+	if form is None: form = FileForm()
+	upload_url = blobstore.create_upload_url('/media/upload')
+	return render_to_response('admin/upload.html', {'upload_url':upload_url,
+													'upload_error': request.session.pop('upload_error', None),
+													'form': form})

Binary file modified.

Binary file modified.

Binary file modified.

pages/pageform.py

     body = forms.CharField(widget=forms.Textarea)
     template = forms.CharField(max_length=30)
     navbar = forms.BooleanField(required=False)
-    publish = forms.BooleanField(required=False)
+    publish = forms.BooleanField()
 
     def save(self, page=None, commit=True):
         data = self.cleaned_data

Binary file modified.

Binary file modified.

Binary file modified.

Binary file modified.

Binary file modified.

 from gaesessions import get_current_session
 
 
-
 def listPost(request):
-	posts = models.Post.all()
+	posts = models.Post.all().order('-pub_date')
 	return render_to_response('admin/postlist.html', {
 													  'posts':posts})
 

Binary file modified.

Binary file modified.

Binary file modified.

Binary file added.

resources/css/admin.css

 body{
-	background-color:#D5DBE0;
+	background-color:#2A378C;
 	text-shadow: 0px 1px 1px #fff;
 }
 
 	-moz-border-radius:6px;
 	-webkit-border-radius:6px;
 	border-radius:6px;
+	color:white;
+	text-shadow:none;
 }
 
 #admin-menu ul .top a:hover, #admin-menu ul .top a:focus{
-	background: rgba(255,255,255,0.8);
-	box-shadow: rgba(255,255,255,0.8) 1px 1px 3px;
+	background: rgba(255,255,255,0.9);
+	box-shadow: rgba(255,255,255,0.9) 1px 1px 3px;
+	color:#2A378C;
 }
 
 #admin-menu ul .item{
 	text-decoration: underline;
 }
 
+div.content{
+	background: rgba(255,255,255,0.8);
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius:6px;
+	padding:5px;
+}
+
+div.content .left-form{
+	background: rgba(255,255,255,0.8);
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius:6px;
+	width:635px;
+	height:500px;
+	float:left;
+}
+div.right-form{
+	width:295px;
+	height:500px;
+	background: rgba(188,204,242,0.5);
+	float:right;
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius:6px;
+}
+
 table{
 	width: 90%;
 	border-collapse:collapse;
 
 td{
 	color:#000;
-	border-bottom:1px solid #e5eff8;
-	border-right:1px solid #e5eff8;
-	border-left:1px solid #e5eff8;
+	border-bottom:1px solid #2A378C;
+	border-right:1px solid #2A378C;
+	border-left:1px solid #2A378C;
 	padding:.3em 1em;
 	text-align:center;
 }
 }
 
 thead th{
-	background:#f4f9fe;
+	background:#2A378C;
 	text-align:center;
 	font:bold 1.2em/2em "Century Gothic","Trebuchet MS",Arial,Helvetica,sans-serif;
-	color:#3C32FA;
+	color:white;
+	text-shadow:none;
 }
 
 thead tr th.first{
 	border-top-right-radius:6px;
 }
 
-
+form select{
+	padding:3px;
+	border-style: solid;
+}
 
 form p label{
 	width: 300;
 
 form input.submit{
 	width:70px;
-	background-color: #878485;
+	background-color: #2A378C;
 	display: inline-block;
 	color: #fff;
 	text-decoration: none;
 }
 form input.submit:hover{
 	cursor: pointer;
-	background-color: #737272;
+	background-color: #20368B;
 }
 
 form input.submit:active{
-	background-color: #5E5E5E;
+	background-color: #1E3480;
 	top:1px;
 }
 

resources/css/codehilite.css

+table.codehilitetable{margin:0 0 0 20px;}
+.codehilitetable td{background-color:#D7F5E1; padding:5px;}
+.codehilite pre { margin-left: 1em; overflow: auto;  width:100%;padding:5px;}
+
+.hll { background-color: #ffffcc }
+.c { color: #408080; font-style: italic } /* Comment */
+.err { border: 1px solid #FF0000 } /* Error */
+.k { color: #008000; font-weight: bold } /* Keyword */
+.o { color: #666666 } /* Operator */
+.cm { color: #408080; font-style: italic } /* Comment.Multiline */
+.cp { color: #BC7A00 } /* Comment.Preproc */
+.c1 { color: #408080; font-style: italic } /* Comment.Single */
+.cs { color: #408080; font-style: italic } /* Comment.Special */
+.gd { color: #A00000 } /* Generic.Deleted */
+.ge { font-style: italic } /* Generic.Emph */
+.gr { color: #FF0000 } /* Generic.Error */
+.gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.gi { color: #00A000 } /* Generic.Inserted */
+.go { color: #808080 } /* Generic.Output */
+.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+.gs { font-weight: bold } /* Generic.Strong */
+.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.gt { color: #0040D0 } /* Generic.Traceback */
+.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
+.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
+.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
+.kp { color: #008000 } /* Keyword.Pseudo */
+.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
+.kt { color: #B00040 } /* Keyword.Type */
+.m { color: #666666 } /* Literal.Number */
+.s { color: #BA2121 } /* Literal.String */
+.na { color: #7D9029 } /* Name.Attribute */
+.nb { color: #008000 } /* Name.Builtin */
+.nc { color: #0000FF; font-weight: bold } /* Name.Class */
+.no { color: #880000 } /* Name.Constant */
+.nd { color: #AA22FF } /* Name.Decorator */
+.ni { color: #999999; font-weight: bold } /* Name.Entity */
+.ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+.nf { color: #0000FF } /* Name.Function */
+.nl { color: #A0A000 } /* Name.Label */
+.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+.nt { color: #008000; font-weight: bold } /* Name.Tag */
+.nv { color: #19177C } /* Name.Variable */
+.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+.w { color: #bbbbbb } /* Text.Whitespace */
+.mf { color: #666666 } /* Literal.Number.Float */
+.mh { color: #666666 } /* Literal.Number.Hex */
+.mi { color: #666666 } /* Literal.Number.Integer */
+.mo { color: #666666 } /* Literal.Number.Oct */
+.sb { color: #BA2121 } /* Literal.String.Backtick */
+.sc { color: #BA2121 } /* Literal.String.Char */
+.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
+.s2 { color: #BA2121 } /* Literal.String.Double */
+.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+.sh { color: #BA2121 } /* Literal.String.Heredoc */
+.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+.sx { color: #008000 } /* Literal.String.Other */
+.sr { color: #BB6688 } /* Literal.String.Regex */
+.s1 { color: #BA2121 } /* Literal.String.Single */
+.ss { color: #19177C } /* Literal.String.Symbol */
+.bp { color: #008000 } /* Name.Builtin.Pseudo */
+.vc { color: #19177C } /* Name.Variable.Class */
+.vg { color: #19177C } /* Name.Variable.Global */
+.vi { color: #19177C } /* Name.Variable.Instance */
+.il { color: #666666 } /* Literal.Number.Integer.Long */

resources/css/default.uni-form.css

+/* ------------------------------------------------------------------------------
+   
+   UNI-FORM DEFAULT by DRAGAN BABIC                         (v2) | Wed, 31 Mar 10
+   
+   ------------------------------------------------------------------------------
+   
+   Copyright (c) 2010, Dragan Babic
+   
+   Permission is hereby granted, free of charge, to any person
+   obtaining a copy of this software and associated documentation
+   files (the "Software"), to deal in the Software without
+   restriction, including without limitation the rights to use,
+   copy, modify, merge, publish, distribute, sublicense, and/or sell
+   copies of the Software, and to permit persons to whom the
+   Software is furnished to do so, subject to the following
+   conditions:
+   
+   The above copyright notice and this permission notice shall be
+   included in all copies or substantial portions of the Software.
+   
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   
+   ------------------------------------------------------------------------------ */
+
+.uniForm{}
+    
+    .uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; }
+  
+    .uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #efefef; }
+    .uniForm .ctrlHolder.focused{ background: #fffcdf; }
+    
+    .uniForm .inlineLabels .noLabel{}
+    
+    .uniForm .buttonHolder{ background: #efefef; text-align: left; padding: 1em;
+                            /* CSS3 */
+                            border-radius:         4px;
+                            -webkit-border-radius: 4px;
+                            -moz-border-radius:    4px;
+                            -o-border-radius:      4px;
+                            -khtml-border-radius:  4px;
+                          }
+      .uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #254a86; border: 1px solid #163362; font-size: 12px; font-weight: bold; color: #fff;
+                                             /* CSS3 */
+                                             border-radius:         4px;
+                                             -webkit-border-radius: 4px;
+                                             -moz-border-radius:    4px;
+                                             -o-border-radius:      4px;
+                                             -khtml-border-radius:  4px;
+                                             box-shadow: 1px 1px 0 #fff;
+                                             -webkit-box-shadow: 1px 1px 0 #fff;
+                                             -moz-box-shadow: 1px 1px 0 #fff;
+                                             text-shadow: -1px -1px 0 rgba(0,0,0,.25);
+                                           }
+      .uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; }
+      .uniForm .secondaryAction            { text-align: left; }
+      .uniForm button.secondaryAction      { background: transparent; border: none; color: #777; margin: 1.25em 0 0 0; padding: 0; }
+      
+        .uniForm .inlineLabels label em,
+        .uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; }
+        .uniForm label small{ font-size: .75em; color: #777; }
+        
+      .uniForm .textInput,
+      .uniForm textarea    { padding: 4px 2px; border: 1px solid #aaa; background: #fff; }
+      .uniForm textarea    { height: 15em; }
+      .uniForm select      {}
+      .uniForm .fileUpload {}
+      
+      .uniForm ul{}
+        .uniForm li{}
+          .uniForm ul li label{ font-size: .85em; }
+            
+            .uniForm .small {}
+            .uniForm .medium{}
+            .uniForm .large {} /* Large is default and should match the value you set for .textInput, textarea or select */
+            .uniForm .auto  {}
+            .uniForm .small,
+            .uniForm .medium,
+            .uniForm .auto{}
+      
+      /* Get rid of the 'glow' effect in WebKit, optional */
+      .uniForm .ctrlHolder .textInput:focus,
+      .uniForm .ctrlHolder textarea:focus{ outline: none; }
+      
+      .uniForm .formHint                    { font-size: .85em; color: #777;  }
+	  .uniForm span.inlineLabels			{ left:0;}
+      .uniForm .inlineLabels .formHint      { padding-top: .5em;}
+      .uniForm .ctrlHolder.focused .formHint{ color: #333; }
+      
+/* ----------------------------------------------------------------------------- */
+/* ############################### Messages #################################### */
+/* ----------------------------------------------------------------------------- */
+
+  /* Error message at the top of the form */
+  .uniForm #errorMsg{ background: #ffdfdf; border: 1px solid #f3afb5; margin: 0 0 1.5em 0; padding: 0 1.5em;
+                      /* CSS3 */
+                      border-radius:         4px;
+                      -webkit-border-radius: 4px;
+                      -moz-border-radius:    4px;
+                      -o-border-radius:      4px;
+                      -khtml-border-radius:  4px;
+                    }
+    .uniForm #errorMsg h3{} /* Feel free to use a heading level suitable to your page structure */
+    .uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; }
+      .uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #f6bec1; position: relative; font-size: .85em;
+                                /* CSS3 */
+                                border-radius:         4px;
+                                -webkit-border-radius: 4px;
+                                -moz-border-radius:    4px;
+                                -o-border-radius:      4px;
+                                -khtml-border-radius:  4px;
+                              }
+  
+  .uniForm .ctrlHolder.error,
+  .uniForm .ctrlHolder.focused.error{ background: #ffdfdf; border: 1px solid #f3afb5;
+                                      /* CSS3 */
+                                      border-radius:         4px;
+                                      -webkit-border-radius: 4px;
+                                      -moz-border-radius:    4px;
+                                      -o-border-radius:      4px;
+                                      -khtml-border-radius:  4px;
+                                    }
+    .uniForm .ctrlHolder.error input.error,
+    .uniForm .ctrlHolder.error select.error,
+    .uniForm .ctrlHolder.error textarea.error{ color: #af4c4c; margin: 0 0 6px 0; padding: 4px; }
+  
+  /* Success messages at the top of the form */
+  .uniForm #okMsg{ background: #c8ffbf; border: 1px solid #a2ef95; margin: 0 0 1.5em 0; padding: 0 1.5em; text-align: center;
+                   /* CSS3 */
+                   border-radius:         4px;
+                   -webkit-border-radius: 4px;
+                   -moz-border-radius:    4px;
+                   -o-border-radius:      4px;
+                   -khtml-border-radius:  4px;
+                 }
+    .uniForm #okMsg p{ margin: 0; }
+
+/* ----------------------------------------------------------------------------- */
+/* ############################### Columns ##################################### */
+/* ----------------------------------------------------------------------------- */
+
+    .uniForm .col{}
+    .uniForm .col.first{}
+    .uniForm .col.last{}
+    .uniForm .col{ margin-bottom: 1.5em; }
+    /* Use .first and .last classes to control the layout/spacing of your columns */
+    .uniForm .col.first{ width: 49%; float: left; clear: none;                   }
+    .uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }

resources/css/theme.css

 body{
-	background-color:#D5DBE0;
+	background-color:#2A378C;
 	text-shadow: 0px 1px 1px #fff;
 }
 
 	-moz-border-radius:6px;
 	-webkit-border-radius:6px;
 	border-radius:6px;
+	color:white;
+	text-shadow: none;
 }
 
 #nav ul a:hover, #nav ul a:active, #nav ul a:focus {
-	background: rgba(255,255,255,0.5);
-	box-shadow: rgba(255,255,255,0.5) 1px 1px 3px;
+	background: rgba(255,255,255,0.8);
+	box-shadow: rgba(255,255,255,0.8) 1px 1px 3px;
+	color:#2A378C;
 }
 
 #main-content .content{
 	padding:5px;
-	margin-right:20px;
+	margin-right:5px;
+	background: rgba(255,255,255,0.7);
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius:6px;
 }
 
 #main-content .title{
 }
 
 
+#side-menu{
+	background: rgba(255,255,255,0.7);
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius:6px;
+}
+
+#side-menu .widget{
+	padding:10px;
+}
 
 #side-menu .side-title{
 	font-weight:bold;
 	box-shadow: rgba(255,255,255,0.5) 1px 1px 3px;
 }
 
-form#contact input{
-	width:270px;
+form{
+	margin:0;
+	padding:0;
+	position:relative;
+	z-index:1;
+	line-height:1.5;
 }
 
-form#contact input.submit{
+form fieldset{
+	border: medium none;
+	margin:0;
+	padding:0;
+}
+
+form .ctrlHolder{
+	border-bottom: 1px solid #EFEFEF;
+	padding:1em;
+}
+
+form .ctrlHolder, form .buttonHolder{
+	clear:both;
+	margin:0;
+	padding: 1em;
+}
+
+form label{
+	display:block;
+	float:none;
+	line-height:100%;
+	width:auto;
+	margin:0 0 0.5em;
+	color:#000;
+}
+
+form .textInput, form textarea{
+	background:none repeat scroll 0 0 #FFFFFF;
+	border: 1px solid #AAAAAA;
+	padding: 4px 2px;
+}
+
+form textarea{
+	height:12em;
+}
+
+form .textInput, form .fileUpload, form .selectInput, form select, form textarea{
+	margin:0;
+	width:90%;
+}
+
+form input.submit{
 	width:70px;
-	background-color: #878485;
+	background-color: #2A378C;
 	display: inline-block;
 	color: #fff;
 	text-decoration: none;
 	border:1px solid #dedede;
 	margin-top:15px;
 }
-form#contact input.submit:hover{
+form input.submit:hover{
 	cursor: pointer;
-	background-color: #737272;
+	background-color: #20368B;
 }
 
-form#contact input.submit:active{
-	background-color: #5E5E5E;
+form input.submit:active{
+	background-color: #1E3480;
 	top:1px;
 }
 
 	color:red;
 	list-style:none;
 	display:inline;
+	margin-left:0;
 }

resources/css/uni-form.css

+/* ------------------------------------------------------------------------------
+
+   Copyright (c) 2010, Dragan Babic
+   
+   Permission is hereby granted, free of charge, to any person
+   obtaining a copy of this software and associated documentation
+   files (the "Software"), to deal in the Software without
+   restriction, including without limitation the rights to use,
+   copy, modify, merge, publish, distribute, sublicense, and/or sell
+   copies of the Software, and to permit persons to whom the
+   Software is furnished to do so, subject to the following
+   conditions:
+   
+   The above copyright notice and this permission notice shall be
+   included in all copies or substantial portions of the Software.
+   
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+
+   ------------------------------------------------------------------------------ */
+/* #############################   GENERALS   ################################### */
+/* ------------------------------------------------------------------------------ */
+
+.uniForm{ margin: 0; padding: 0; position: relative; z-index: 1; } /* reset stuff */
+  
+  /* Some generals and more resets */
+  .uniForm fieldset{ border: none; margin: 0; padding: 0; }
+    .uniForm fieldset legend{ margin: 0; padding: 0; }
+    
+    /* This are the main units that contain form elements */
+    .uniForm .ctrlHolder,
+    .uniForm .buttonHolder{ margin: 0; padding: 0; clear: both; }
+    
+    /* Clear all floats */ 
+    .uniForm:after,
+      .uniForm .buttonHolder:after, 
+      .uniForm .ctrlHolder:after, 
+        .uniForm .ctrlHolder .multiField:after,
+          .uniForm .inlineLabel:after{ content: "."; display: block; height: 0; line-height: 0; font-size: 0; clear: both; min-height: 0; visibility: hidden; }
+      
+      .uniForm label,
+      .uniForm button{ cursor: pointer; }
+
+/* ------------------------------------------------------------------------------ */
+/* ##########################   DEFAULT LAYOUT   ################################ */
+/* ------------------------------------------------------------------------------ */
+/*       Styles for form controls where labels are above the input elements       */
+/* ------------------------------------------------------------------------------ */
+
+      .uniForm label,
+      .uniForm .label{ display: block; float: none; margin: 0 0 .5em 0; padding: 0; line-height: 100%; width: auto; }
+      
+      /* Float the input elements */
+      .uniForm .textInput,
+      .uniForm .fileUpload,
+      .uniForm .selectInput,
+      .uniForm select,
+      .uniForm textarea{ float: left; width: 90%; margin: 0; }
+      
+      /* Postition the hints */
+      .uniForm .formHint{ float: left; width: 43%; margin: 0; clear: none; }
+      
+      /* Position the elements inside combo boxes (multiple inputs/selects/checkboxes/radio buttons per unit) */
+      .uniForm ul{ float: left; width: 53%; margin: 0; padding: 0; }
+        .uniForm ul li{ margin: 0 0 .5em 0; list-style: none; }
+          .uniForm ul li label{ margin: 0; float: none; display: block; overflow: visible; }
+        /* Alternate layout */
+        .uniForm ul.alternate li{ float: left; width: 30%; margin-right: 3%; }
+          .uniForm ul.alternate li label{ float: none; display: block; width: 98%; }
+            .uniForm ul .textInput,
+            .uniForm ul .selectInput,
+            .uniForm ul select,
+            .uniForm ul.alternate .textInput,
+            .uniForm ul.alternate .selectInput,
+            .uniForm ul.alternate select{ width: 98%; margin-top: .5em; display: block; float: none; }
+            
+        /* Required fields asterisk styling */
+        .uniForm label em,
+        .uniForm .label em{ float: left; width: 1em; margin: 0 0 0 -1em; }
+
+/* ------------------------------------------------------------------------------ */
+/* #########################   ALTERNATE LAYOUT   ############################### */
+/* ------------------------------------------------------------------------------ */
+/*    Styles for form controls where labels are in line with the input elements   */
+/*    Set the class of the parent (preferably to a fieldset) to .inlineLabels     */
+/* ------------------------------------------------------------------------------ */
+
+      .uniForm .inlineLabels label,
+      .uniForm .inlineLabels .label{ float: left; margin: .3em 2% 0 0; padding: 0; line-height: 1; position: relative; width: 32%; }
+      
+      /* Float the input elements */
+      .uniForm .inlineLabels .textInput,
+      .uniForm .inlineLabels .fileUpload,
+      .uniForm .inlineLabels .selectInput,
+      .uniForm .inlineLabels select,
+      .uniForm .inlineLabels textarea{ float: left; width: 64%; }
+
+    /* Postition the hints */
+    .uniForm .inlineLabels .formHint{ clear: both; float: left; width: auto; margin-left: 0%; position: static; }
+    
+    /* Position the elements inside combo boxes (multiple inputs/selects/checkboxes/radio buttons per unit) */
+    .uniForm .inlineLabels ul{ float: left; width: 66%; }
+      .uniForm .inlineLabels ul li{ margin: .5em 0; }
+        .uniForm .inlineLabels ul li label{ float: none; display: block; width: 100%; }
+      /* Alternate layout */
+      .uniForm .inlineLabels ul.alternate li{ margin-right: 3%; margin-top: .25em; }
+          .uniForm .inlineLabels ul li label .textInput,
+          .uniForm .inlineLabels ul li label textarea,
+          .uniForm .inlineLabels ul li label select{ float: none; display: block; width: 98%;  }
+    
+    /* Required fields asterisk styling */
+    .uniForm .inlineLabels label em,
+    .uniForm .inlineLabels .label em{ display: block; float: none; margin: 0; position: absolute; right: 0; }
+
+/* ----------------------------------------------------------------------------- */
+/* ########################### Additional Stuff ################################ */
+/* ----------------------------------------------------------------------------- */
+
+  /* Generals */
+    .uniForm legend{ color: inherit; }
+    
+      .uniForm .secondaryAction{ float: left; }
+      
+      /* .inlineLabel is used for inputs within labels - checkboxes and radio buttons */
+      .uniForm .inlineLabel input,
+      .uniForm .inlineLabels .inlineLabel input,
+      .uniForm .blockLabels .inlineLabel input,
+      /* class .inlineLabel is depreciated */
+      .uniForm label input{ float: none; display: inline; margin: 0; padding: 0; border: none; }
+            
+      .uniForm .buttonHolder .inlineLabel,
+      .uniForm .buttonHolder label{ float: left; margin: .5em 0 0 0; width: auto; max-width: 60%; text-align: left; }
+      
+      /* When you don't want to use a label */
+      .uniForm .inlineLabels .noLabel ul{ margin-left: 34%; /* Match to width of label + gap to field */ }
+      
+      /* Classes for control of the widths of the fields */
+      .uniForm .small { width: 30% !important; }
+      .uniForm .medium{ width: 45% !important; }
+      .uniForm .large {  } /* Large is default and should match the value you set for .textInput, textarea or select */
+      .uniForm .auto  { width: auto !important; }
+      .uniForm .small,
+      .uniForm .medium,
+      .uniForm .auto{ margin-right: 4px; }
+
+/* Columns */
+.uniForm .col{ float: left; }
+.uniForm .col{ width: 50%; }
 
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
-#    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
 #    'django.contrib.auth.middleware.AuthenticationMiddleware',
 #    'django.middleware.doc.XViewMiddleware',
 )

Binary file modified.

+import sys, logging
+
+logger = logging.getLogger('')
+logger.setLevel(logging.DEBUG)
+handler = logging.StreamHandler(sys.stderr)
+handler.setLevel(logging.DEBUG)
+formatter = logging.Formatter('%(levelname)-8s %(message)s')
+handler.setFormatter(formatter)
+logger.addHandler(handler)

templates/admin/base.html

 <link rel="stylesheet" href="/resources/css/uni-form.css" type="text/css" />
 <link rel="stylesheet" href="/resources/css/default.uni-form.css" type="text/css" />
 
-<script src="/resourcse/js/uni-form.jquery.js" type="text/javascript"></script>
 
 
 </head>
 
 	<div class="clear" style="height:130"></div>
 
-	{% block content %}{% endblock %}
-
+	<div id-"main-content" class="grid_12">
+		<div class="content">
+		{% block content %}{% endblock %}
+		</div>
+	</div>
 </div>
 </body>
 </html>

templates/admin/newpage.html

 {% extends 'admin/base.html' %}
 
 {% block content %}
-<div id="content" class="grid_12">
-	<form method="POST" action="{% if action %}{{ action }}{% else %}/page/new/{% endif %}">
-		{{ pageForm.as_p }}
-	<p><input class="submit" type="submit" value="Save"/></p>
-	</form>
+<form class="uniform" method="POST" action="{% if action %}{{ action }}{% else %}/page/new/{% endif %}">
+<fieldset>
+<div class="left-form">
+			<div class="ctrlHolder">
+				<label for="id_name" style="display:block">Name {{ pageForm.name.errors }}</label>
+				<input id="id_name" class="textInput" type="text" size="50" name="name" max_length="100"/>
+				<span class="inlineLabels"><p class="formHint">Max : 100 characters</p></span>
+			</div>
+			<div class="ctrlHolder">
+				<label for="id_description" style="display:block">Description {{ pageForm.description.errors }}</label>
+				<input id="id_description" class="textInput" type="text" size="50" name="description" max_length="100">
+				<span class="inlineLabels"><p class="formHint">(Optional) Max : 300 characters</p></span>
+			</div>
+			<div class="ctrlHolder">
+				<label for="id_body" style="display:block">Body {{ pageForm.body.errors }}</label>
+				<textarea id="id_body" name="body" cols="40" rows="18"></textarea>
+				<span class="inlineLabels"><p class="formHint">Use markdown to style the text.
+					<a href="http://daringfireball.net/projects/markdown/basics">Please read documentation</a></p></span>
+			</div>
+			<div class="buttonHolder">
+				<input class="submit" type="submit" value="Save"/>
+			</div>
 </div>
+<div class="right-form">
+	<div class="ctrlHolder">
+		<label for="id_publish" style="display:block">Publish {{ pageForm.publish.errors }}</label>
+		<select id="id_publish" class=""name="publish">
+			<option value="Published">Publish Now</option>
+			<option value="Private">Private</option>
+			<option value="Draft">Draft</option>
+		</select>
+	</div>
+	<div class="ctrlHolder">
+		<label for="id_navbar" style="display:block">Side Bar {{ pageForm.navbar.errors }}</label>
+		<select id="id_navbar" class=""name="navbar">
+			<option value="True">True</option>
+			<option value="False">False</option>
+		</select>
+	</div>
+	<div class="ctrlHolder">
+		<label for="id_template" style="display:block">Template {{ pageForm.template.errors }}</label>
+		<input id="id_template" class="textInput" type="text"name="template"/>
+		<span class="inlineLabels"><p class="formHint">Template Filename (*.html)</p></span>
+	</div>
+</div>
+</fieldset>
+</form>
 {% endblock %}

templates/admin/newpost.html

-
 {% extends 'admin/base.html' %}
 
 {% block content %}
-<div id="content" class="grid_12">
-	<form method="POST" action="{% if action %}{{ action }}{% else %}/post/new/{% endif %}">
-		{{ postForm.as_p }}
-	<p><input class="submit" type="submit" value="Publish"/>
-	</form>
+<form class="uniform" method="POST" action="{% if action %}{{ action }}{% else %}/post/new/{% endif %}">
+<fieldset>
+<div class="left-form">
+			<div class="ctrlHolder">
+				<label for="id_title" style="display:block">Title {{ postForm.title.errors }}</label>
+				<input id="id_title" class="textInput" type="text" size="50" name="title" max_length="100">
+				
+				<span class="inlineLabels"><p class="formHint">Max : 100 characters</p></span>
+			</div>
+			<div class="ctrlHolder">
+				<label for="id_body" style="display:block">Body {{ postForm.body.errors }}</label>
+				<textarea id="id_body" name="body" cols="40" rows="18"></textarea>
+				<span class="inlineLabels"><p class="formHint">Use markdown to style the text.
+					<a href="http://daringfireball.net/projects/markdown/basics">Please read documentation</a></p></span>
+			</div>
+			<div class="buttonHolder">
+				<input class="submit" type="submit" value="Publish"/>
+			</div>
+
 </div>
+<div class="right-form">
+	<div class="ctrlHolder">
+		<label for="id_category" style="display:block">Category {{ postForm.category.errors }}</label>
+		<input id="id_category" class="textInput" type="text" size="50" name="category" max_length="30">
+		<span class="inlineLabels"><p class="formHint">Word or Phrase</p></span>
+	</div>
+	<div class="ctrlHolder">
+		<label for="id_tags" style="display:block">Tags {{ postForm.tags.errors }}</label>
+		<input id="id_tags" class="textInput" type="text" size="50" name="tags">
+		<span class="inlineLabels"><p class="formHint">Separate by space</p></span>
+	</div>
+</div>
+</fieldset>
+</form>
 {% endblock %}

templates/admin/pagelist.html

 {% extends 'admin/base.html' %}
 
 {% block content %}
-<div class="grid_12">
+
 	<h3>Pages</h3>
 	<table>
 		<thead>
 			</tr>
 		</thead>
 		<tbody>
-		{% if pages %}
+		{% if pages.count > 0 %}
 			{% for p in pages %}
 				<tr>
 					<td><a href="{{ p.get_edit_url }}">Edit</a> | <a href="{{ p.get_delete_url }}">Remove</a></td>
 				</tr>
 			{% endfor %}
 		{% else %}
-			No Page
+			<tr><td colspan="5" style="text-align:left;font-size:15">No Page</td></tr>
 		{% endif %}
 		</tbody>
 	</table>
-</div>
 {% endblock %}

templates/admin/postlist.html

 {% extends 'admin/base.html' %}
 
 {% block content %}
-<div class="grid_12">
 	<h3>Posts</h3>
 	<table>
 		<thead>
 			</tr>
 		</thead>
 		<tbody>
-		{% if posts %}
+		{% if posts.count > 0 %}
 			{% for p in posts %}
 				<tr>
 					<td><a href="{{ p.get_edit_url }}">Edit</a> | <a href="{{ p.get_delete_url }}">Remove</a></td>
 				</tr>
 			{% endfor %}
 		{% else %}
-			No Post
+			<tr><td colspan="3" style="text-align:left;font-size:15">No Post</td></tr>
 		{% endif %}
 		</tbody>
 	</table>
-</div>
 {% endblock %}

templates/admin/upload.html

+{% extends 'admin/base.html' %}
+
+{% block content %}
+	<form action="{{ upload_url }}" method="POST" enctype="multipart/form-data">
+	{% if upload_error %}<span>{{ upload_error }}</span>{% endif %}
+	
+	{{ form.as_p }}
+	<p>
+	<label for="fileupload">Upload Media :</label>
+	<input type="file" name="media"><br>
+	</p>
+	<p>
+	<input class="submit" type="submit" name="submit" value="Upload">
+	</p>
+	</form>
+{% endblock %}

templates/front/base.html

 <link rel="stylesheet" type="text/css" media="all" href="/resources/css/text.css" />
 <link rel="stylesheet" type="text/css" media="all" href="/resources/css/960.css" />
 <link rel="stylesheet" type="text/css" media="all" href="/resources/css/theme.css" />
+<link rel="stylesheet" type="text/css" media="all" href="/resources/css/codehilite.css" />
 
 <script src="/resources/js/chat.js" type="text/javascript"></script>
 

templates/front/post.html

 	<span class="date">Writen at {{ post.pub_date.year }}-{{ post.pub_date.month }}-{{ post.pub_date.day }}</span>
 	<p>
 		{% autoescape off %}
-		{{ post.body_html }}
+		{{ post.body_html|safe }}
 		{% endautoescape %}
 	</p>
 	<div class="clear"></div>
 
 
 {% block side_menu %}
+<div class="widget">
 <span class="side-title">Categories</span>
 <div class="nav-cat">
 	<ul>
 	{% endfor %}
 	</ul>
 </div>
-<div class-"clear></div>
+</div>
+<div class-"clear"></div>
 
+<div class="widget">
 <span class="side-title">Tags</span>
 <div class="nav-cat">
 	<ul>
 	{% endfor %}
 	</ul>
 </div>
+</div>
 {% endblock %}

templates/front/stream.html

 {% extends 'front/base.html' %}
 
 {% block main_content %}
+{% if posts %}
 {% for p in posts %}
 	<h3 class="title"><a href="{{ p.get_absolute_url }}">{{ p.title}}</a></h3>
 	<span class="date">Writen at {{ p.pub_date.year }}-{{ p.pub_date.month }}-{{ p.pub_date.day }}</span>
 
 {% if paging.prev %}<a href="/?page={{ paging.prev }}">Prev Posts</a> &nbsp;&nbsp;{% endif %}
 {% if paging.next %}<a href="/?page={{ paging.next }}">More Post</a>{% endif %}
-
+{% else %}
+	<h3>No Post</h3>
+{% endif %}
 {% endblock %}
 
 
 {% block side_menu %}
+<div class="widget">
 <span class="side-title">Categories</span>
 <div class="nav-cat">
 	<ul>
 	{% endfor %}
 	</ul>
 </div>
-
+</div>
 <div class="clear"></div>
 
+<div class="widget">
 <span class="side-title">Tags</span>
 <div class="nav-cat">
 	<ul>
 	{% endfor %}
 	</ul>
 </div>
+</div>
 {% endblock %}

templates/pages/contact.html

 
 {% block main_content %}
 <div style="width:400px">
-	<form id="contact" action="/contact/" method="POST">
-		{{ form.as_p }}
-		{% if msg %}<span class="msg">{{ msg }}</span>{% endif %}
+	<form action="/contact/" method="POST">
+		<fieldset>
+			<div class="ctrlHolder">
+				<label for="id_name" style="display:block">Name {{ form.name.errors }}</label>
+				<input id="id_name" class="textInput" type="text" size="50" name="name"/>
+			</div>
+			<div class="ctrlHolder">
+				<label for="id_email" style="display:block">Email {{ form.email.errors }}</label>
+				<input id="id_email" class="textInput" type="text" size="50" name="name" />
+			</div>
+			<div class="ctrlHolder">
+				<label for="id_message" style="display:block">Message {{ form.message.errors }}</label>
+				<textarea id="id_message" name="body" cols="40" rows="18"></textarea>
+			</div>
+			{% if msg %}<span class="msg">{{ msg }}</span>{% endif %}
 
-		<p><input class="submit" type="submit" value="Send" /></p>
+			<div class="buttonHolder"><input class="submit" type="submit" value="Send" /></div>
+		</fieldset>
 	</form>
 </div>
 {% endblock %}
     (r'^page/new/', 'pages.views.newPage'),
     (r'^page/edit/([-\w]+)', 'pages.views.editPage'),
     (r'^page/delete/([-\w]+)', 'pages.views.delPage'),
+
+	(r'^media/upload/', 'media.views.upload'),
+	
     (r'^contact/$', 'pages.views.contact'),
     (r'^([-\w]+)', 'pages.views.render'),
 )

Binary file modified.

Empty file added.

utilities/appengine.py

+from django.http import HttpResponsePermanentRedirect
+from google.appengine.api import users
+
+def loginrequired(func):
+    def redirect_to_login(request):
+        return HttpResponsePermanentRedirect(users.create_login_url(request.get_full_path()))
+
+    user = users.get_current_user()
+    if user:
+        return func
+    else:
+        return redirect_to_login

utilities/logging.py

+def log_traceback(exception, args):
+    import sys, traceback, logging
+    exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
+    logging.debug(exception)
+    logging.debug(args)
+    for tb in traceback.format_exception(exceptionType, exceptionValue, exceptionTraceback):
+        logging.debug(tb)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.