Commits

reorx committed a2e4a92

going to work at pilved, this will be a checkpoint.

Comments (0)

Files changed (10)

 
 urlpatterns = patterns('',
     (r'^$', home),
+    (r'^(\d+)/', home),
     # Example:
     # (r'^blog/', include('blog.foo.urls')),
 

blog/urls.pyc

Binary file modified.
 # from my_PIGS.default.knowledge #
 ######
 from my_PIGS.default.knowledge.query.get import blog_all
+from my_PIGS.utils import fn
 
-def home(request,template_name='blog/home.html'):
+def home(request,p=0,template_name='blog/home.html'):
+    # blog_all blog_list
+    # blog_full blog_title
     blogs = blog_all()
+    page_limit = 3
+    blog_thispage , page = fn.pageSplit(blogs,page_limit,int(p))
     return render_to_response(template_name,{
-        'blogs' : blogs,
+        'blogs' : blog_thispage,
+        #'blogs' : blogs,
+        'page' : page,
         }
     )

blog/views.pyc

Binary file modified.

default/knowledge/query/get.pyc

Binary file modified.
 # 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 = 'http://localhost/django_admin_media/'
+# ADMIN_MEDIA_PREFIX = 'http://localhost/django_admin_media/'
 
 # Make this unique, and don't share it with anybody.
 SECRET_KEY = '4x+lg84h@$w^d+e$w197!!vy9w!a(oe2ae!xe+5m$n8*+cwuef'
     'django.contrib.messages',
     # admin #
     'django.contrib.admin',
-    # markdown #
+    # filters #
     'django.contrib.markup',
+    'my_filters',
     # project apps #
     'default',
     'custom',

settings.pyc

Binary file modified.

static/blog/css/style.css

 }
 div#Header {
     height: 100px;
-    border-bottom: 1px solid #000;
     position: relative;
 }
 div#Header .title {
     width: 100%;
     margin-bottom: 10px;
     overflow: hidden;
+    position: relative;
 }
 .blog .title{
     float:left;
-    width: 200px;
+    width: 200px; height: 40px;
 }
 .blog .info{
     float:right;
-    width: 200px;
+    width: 200px; height: 20px;
 }
 .blog .content{
     float:left;
-    width: 100%;
+    width: 720px;
+    padding: 0 10px 0 10px;
+}
+#pageSplit {
+    margin-top: 20px;
+    margin-bottom: 10px;
 }
 div#Footer {
     height: 40px;
     height: 20px;
 }
 /* decoration */
-#body_wrap, #Header, #Main, #Footer {
-    border-color: #999;
-    border-style: solid;
+#body_wrap, #Header, #Main, #Footer, .blog {
+    border: 1px solid #999;
 }
-div#body_wrap {
-    border-left-width: 1px;
-    border-right-width: 1px;
+#body_wrap {
+    border-top: none;
+    border-bottom: none;
 }
-div#Header {
-    border-bottom-width: 1px;
+#Header {
+    border-top: none;
+    border-left: none;
+    border-right: none;
 }
-div#Main {
+#Main {
+    border: none;
 }
-div#Main .container {
+#Main .container {
     padding: 10px 20px 10px 20px;
 }
-div.blog {
-    border-bottom: 1px solid #aaa;
+.blog {
+    border-top: none;
+    border-left: none;
+    border-right: none;
 }
-div#Footer {
-    border-top-width: 1px;
-    border-bottom-width: 1px;
+#pageSplit {
+    overflow: hidden;
+}
+#pageSplit ul {
+    list-style: none;
+    padding: 0px;margin: 0px;
+    overflow: hidden;
+    float: right;
+}
+#pageSplit li {
+    float: left;
+    width: 20px;height: 20px;
+    margin: 3px 3px 3px 10px;
+    background: #ddd;
+    -webkit-border-radius: 20px;
+}
+#pageSplit a:hover > li {
+    background: #fff;
+    -webkit-box-shadow: 0px 0px 5px #ff008a;
+    color: #333;
+}
+#pageSplit a:active > li {
+    color: #fff;
+    background: #7cd305;
+    -webkit-box-shadow: none;
+}
+#pageSplit .in {
+    color: #fff;
+    background: #7cd305;
+    -webkit-box-shadow: none;
+}
+#Footer {
+    border-left: none;
+    border-right: none;
 }
 div#Footer .upPart, div#Footer .downPart {
     text-align: center;
 }
+
 /* text style */
 div#Header .title {
-    font-size: 30px;
-    font-weight: bold;
+    font-family:'Tangerine', arial, serif;
+    font-size: 43px;
+    font-weight: normal;
     text-align: center;
     line-height: 100px;
     letter-spacing: 3px;
     color: #666;
+    /*text-shadow: 0px 0px 4px #fff89f;*/
 }
 #Header .subtitle {
     font-size: 15px;;
-    text-align: center;
+    text-align: left;
     color: #888;
     font-style: italic;
+    border-right: 8px solid #aaa;
+}
+.blog {
+}
+.blog .title {
+    font-family:'Josefin Sans', arial, serif;
+    line-height: 10px;
+    font-size: 28px;
+    letter-spacing: 2px;
+    color: #2869a9;
+    font-weight: bold;
+}
+.blog .info {
+    font-size: 12px;
+    letter-spacing: 1px;
+    line-height: 20px;
+    color: #888;
+    font-style: italic;
+}
+.blog .content {
+    font-family:'Cantarell', arial, serif;
+    font-size: 13px;
+    line-height: 1.5em;
+    letter-spacing: 0.5px;
+    word-spacing: 2px;
+    color: #333;
+}
+#pageSplit li {
+    text-align: center;
+    font-size: 13px;
+    line-height: 20px;
+}
+#pageSplit a, #pageSplit a:visited {
+    text-decoration: none;
+    color: #333;
 }
 #Footer span.normal_grey {
     font-size: 13px;;

templates/blog/base.html

 <head>
 	<meta charset="UTF-8">
 	<title>Blog #of PIGS</title>
+    <!-- css fonts -->
+    <link href='http://fonts.googleapis.com/css?family=Tangerine' rel='stylesheet' type='text/css'>
+    <link href='http://fonts.googleapis.com/css?family=Josefin+Sans' rel='stylesheet' type='text/css'>
+    <link href='http://fonts.googleapis.com/css?family=Cantarell' rel='stylesheet' type='text/css'>
+    <!-- endcss -->
     <link media="all" rel="stylesheet" href="/static/blog/css/style.css" type="text/css" />
-    <script src="" type="text/javascript"></script>
+    <!-- script greader_embed -->
+    <!-- endscript -->
+    <!-- css greader_embed -->
+    <style type="text/css">
+        #readerpublishermodule0 {
+            position: fixed;
+            top: 200px;left:0px;
+            width: 180px;
+        }
+    </style>
+    <!-- endcss -->
     {% block head_extra %}
     {% endblock %}
 </head>

templates/blog/home.html

 {% extends 'blog/base.html' %}
 
+{% load markup %}
+{% load my_filters %}
+
 {% block head_extra %}
 {% endblock %}
 
         {{ b.dtime }}
         </div>
         <div class="content">
-        {{ b.content }}
+        {{ b.content|markdown }}
         </div>
     </div>
     {% endfor %}
+    <div id="pageSplit">
+        <ul>
+            {% ifequal page.now '0' %}
+            {% else %}
+                <a href="/blog/{{ page.pre }}/"><li><</li></a>
+            {% endifequal %}
+            {% for p in page.list %}
+                {% ifequal p '...'  %}
+                <li>···</li>
+                {% else %}
+                    {% ifequal p page.now  %}
+                    <a href="/blog/{{ p }}/"><li class="in">{{ p }}</li></a>
+                    {% else %}
+                    <a href="/blog/{{ p }}/"><li>{{ p }}</li></a>
+                    {% endifequal %}
+                {% endifequal %}
+            {% endfor %}
+            {% ifequal page.now page.final %}
+            {% else %}
+                <a href="/blog/{{ page.next }}/"><li>></li></a>
+            {% endifequal %}
+        </ul>
+    </div>
 {% endblock %}