閑來無事,就自己看看Django,然后寫個個人博客,尚未完成!以后會不斷更新此博客的,完全開源,回頭掛在Git上!
這是我的開發目錄,很簡單的一個個人博客
/blog/:
models.py

1 #!/usr/bin/env python 2 #coding=utf-8 3 from django.db import models 4 import datetime,time,os 5 from django.utils import timezone 6 from django.contrib.auth.models import User 7 8 # Create your models here. 9 10 class index_show(models.Model): 11 '''show_contents:內容,img_title:image title,img_path:image url''' 12 show_contents=models.TextField() 13 show_img_title=models.CharField(max_length=100) 14 show_img_path=models.FileField(upload_to=u'./xysite/static/upload') 15 #show_img_path=models.FileField(upload_to=handle_uploaded_file,null =True, blank=True) 16 #show_img_path=models.ImageField(upload_to='./xysite/static/upload',null =True, blank=True) 17 show_datetime=models.DateTimeField(default=datetime.datetime.now()) 18 def __unicode__(self): 19 return self.show_img_title 20 def was_published_recently(self): 21 return self.show_datetime >=timezone.now()-datetime.timedelta(days=1) 22 class blog_show(models.Model): 23 blog_title=models.CharField(max_length=200) 24 blog_contents=models.TextField() 25 blog_user=models.ForeignKey(User) 26 blog_datetime=models.DateTimeField(default=datetime.datetime.now()) 27 blog_img_title=models.CharField(max_length=100) 28 blog_img_path=models.FileField(upload_to='./xysite/static/upload/blog') 29 def __unicode__(self): 30 return self.blog_title 31 def was_published_recently(self): 32 return self.blog_datetime >=timezone.now()-datetime.timedelta(days=1) 33 34 ''' 35 def handle_uploaded_file(f): 36 file_name = "" 37 38 try: 39 path = "./xysite/static/upload" + time.strftime('/%Y/%m/%d/%H/%M/%S/') 40 if not os.path.exists(path): 41 os.makedirs(path) 42 file_name = path + f.name 43 destination = open(file_name, 'wb+') 44 for chunk in f.chunks(): 45 destination.write(chunk) 46 destination.close() 47 except Exception, e: 48 print e 49 50 return file_name 51 '''
urls.py

1 #!/usr/bin/env python 2 #coding=utf-8 3 from django.conf.urls import patterns, include, url 4 5 6 urlpatterns = patterns('', 7 # Examples: 8 # url(r'^$', 'xysite.views.home', name='home'), 9 # url(r'^blog/', include('blog.urls')), 10 11 #url(r'^$', 'blog.views.index',name='index'), 12 url(r'^blogshow/$', 'blog.views.blogshow',name='blogshow'), 13 )
views.py

1 #!/usr/bin/env python 2 #coding=utf-8 3 from django.shortcuts import render,render_to_response,RequestContext 4 from blog.models import index_show,blog_show 5 6 # Create your views here. 7 def index(request): 8 posts=index_show.objects.last() 9 #return render_to_response('blog/index.html') 10 set_pic_url=posts.show_img_path 11 set_url=str(set_pic_url)[14:] 12 #set_url=set_pic_url[10:] 13 #print posts.show_img_path,str(set_pic_url)[14:] 14 15 forms=blog_show.objects.all() 16 for fors in forms: 17 #print fors.blog_img_path 18 fors.blog_img_path=str(fors.blog_img_path)[14:] 19 print 'end:',fors.blog_img_path 20 21 print "len_forms:",len(forms),forms[0].blog_img_title 22 23 return render_to_response('blog/index.html',{"posts":posts,"set_urls":set_url,"forms":forms},context_instance = RequestContext(request)) 24 def blogshow(request): 25 forms=blog_show.objects.all() 26 for fors in forms: 27 #print fors.blog_img_path 28 fors.blog_img_path=str(fors.blog_img_path)[14:] 29 #print 'end:',fors.blog_img_path 30 31 32 return render_to_response('blog/blogshow.html',{"forms":forms},context_instance = RequestContext(request))
/xysite/xysite/:
setting.py

1 #!/usr/bin/env python 2 #coding=utf-8 3 """ 4 Django settings for xysite project. 5 6 For more information on this file, see 7 https://docs.djangoproject.com/en/1.6/topics/settings/ 8 9 For the full list of settings and their values, see 10 https://docs.djangoproject.com/en/1.6/ref/settings/ 11 """ 12 13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 14 import os 15 BASE_DIR = os.path.dirname(os.path.dirname(__file__)) 16 TEMPLATE_DIRS=( 17 os.path.join(os.path.split(os.path.dirname(__file__))[0],'templates').replace('\\','/'), 18 #os.path.join(os.path.split(os.path.dirname(__file__))[0],'static').replace('\\','/') 19 ) 20 21 # Quick-start development settings - unsuitable for production 22 # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ 23 24 # SECURITY WARNING: keep the secret key used in production secret! 25 SECRET_KEY = '+6e_&*3l*(ahortmt5jcd*go%splon_q*^ws8can6k0sajf0e^' 26 27 # SECURITY WARNING: don't run with debug turned on in production! 28 DEBUG = True 29 30 TEMPLATE_DEBUG = True 31 32 ALLOWED_HOSTS = [] 33 34 35 # Application definition 36 37 INSTALLED_APPS = ( 38 'django.contrib.admin', 39 'django.contrib.auth', 40 'django.contrib.contenttypes', 41 'django.contrib.sessions', 42 'django.contrib.messages', 43 'django.contrib.staticfiles', 44 'blog', 45 'pagination', 46 ) 47 48 MIDDLEWARE_CLASSES = ( 49 'django.contrib.sessions.middleware.SessionMiddleware', 50 'django.middleware.common.CommonMiddleware', 51 'django.middleware.csrf.CsrfViewMiddleware', 52 'django.contrib.auth.middleware.AuthenticationMiddleware', 53 'django.contrib.messages.middleware.MessageMiddleware', 54 'django.middleware.clickjacking.XFrameOptionsMiddleware', 55 'pagination.middleware.PaginationMiddleware', 56 57 ) 58 TEMPLATE_CONTEXT_PROCESSORS = ( 59 # 'django.core.context_processors.auth', 60 'django.contrib.auth.context_processors.auth', 61 'django.core.context_processors.debug', 62 'django.core.context_processors.i18n', 63 'django.core.context_processors.media', 64 'django.core.context_processors.request', 65 ) 66 67 ROOT_URLCONF = 'xysite.urls' 68 69 WSGI_APPLICATION = 'xysite.wsgi.application' 70 71 72 # Database 73 # https://docs.djangoproject.com/en/1.6/ref/settings/#databases 74 75 DATABASES = { 76 'default': { 77 'ENGINE': 'django.db.backends.sqlite3', 78 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 79 } 80 } 81 82 # Internationalization 83 # https://docs.djangoproject.com/en/1.6/topics/i18n/ 84 85 LANGUAGE_CODE = 'zh-cn' 86 87 TIME_ZONE = 'Asia/Shanghai' 88 89 USE_I18N = True 90 91 USE_L10N = True 92 93 USE_TZ = True 94 95 96 # Static files (CSS, JavaScript, Images) 97 # https://docs.djangoproject.com/en/1.6/howto/static-files/ 98 99 100 HERE=os.path.dirname(os.path.abspath(__file__)) 101 STATIC_ROOT=os.path.join(HERE,'static').replace('\\','/') 102 # Static files (CSS, JavaScript, Images) 103 # https://docs.djangoproject.com/en/1.6/howto/static-files/ 104 STATICFILES_DIRS = ( 105 # Put strings here, like "/home/html/static" or "C:/www/django/static". 106 # Always use forward slashes, even on Windows. 107 # Don't forget to use absolute paths, not relative paths. 108 os.path.join(BASE_DIR,'static'), 109 'E:/PYDEV/xysite/static/', 110 ) 111 112 STATIC_URL = '/static/'
url.py

1 #!/usr/bin/env python 2 #coding=utf-8 3 from django.conf.urls import patterns, include, url 4 from blog import views 5 from django.contrib import admin 6 admin.autodiscover() 7 8 urlpatterns = patterns('', 9 # Examples: 10 # url(r'^$', 'xysite.views.home', name='home'), 11 # url(r'^blog/', include('blog.urls')), 12 13 url(r'^admin/', include(admin.site.urls)), 14 url(r'^$', 'blog.views.index',name='index'), 15 url(r'^blog/', include('blog.urls')), 16 )
responsive.css

1 html { 2 -webkit-text-size-adjust: none; 3 } 4 .video embed, 5 .video object, 6 .video iframe { 7 width: 100%; 8 height: auto; 9 } 10 img{ 11 max-width:100%; 12 height: auto; 13 width: auto\9; /* ie8 */ 14 } 15 16 @media only screen and (max-width: 959px) { 17 nav .wrap-nav{margin-top: 10px; float: left; background: #2ECC71; width: 100%;} 18 #contact-form, #contact-form textarea, #contact-form input{width: 95%;} 19 } 20 21 @media only screen and (max-width: 767px) { 22 #main-content article .heading, #main-content article .content{ padding: 20px;} 23 .menu ul li {padding: 18px 5px 11px 5px;} 24 .menu ul li a {font-size: 12px; padding: 3px 5px;} 25 } 26 27 28 @media only screen and (max-width: 479px) { 29 .menu ul li {padding: 15px 5px 8px 5px;} 30 .menu ul li a {font-size: 8px; padding: 3px 5px;} 31 }
styles.css

1 /* 2 Free Html5 Responsive Templates 3 Author: Kimmy 4 Author URI: http://www.zerotheme.com/ 5 */ 6 /* -------------------------------------------- */ 7 /* ------------------Reset--------------------- */ 8 a,abbr,acronym,address,applet,article,aside,audio,b,blockquote,big,body,center,canvas,caption,cite,code,command,datalist,dd,del,details,dfn,dl,div,dt,em,embed,fieldset,figcaption,figure,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,keygen,label,legend,li,meter,nav,object,ol,output,p,pre,progress,q,s,samp,section,small,span,source,strike,strong,sub,sup,table,tbody,tfoot,thead,th,tr,tdvideo,tt,u,ul,var{background:transparent;border:0 none;font-size:100%;margin:0;padding:0;border:0;outline:0;vertical-align:top;}ol, ul {list-style:none;}blockquote, q {quotes:none;}table, table td {padding:0;border:none;border-collapse:collapse;}img {vertical-align:top;}embed {vertical-align:top;} 9 article, aside, audio, canvas, command, datalist, details, embed, figcaption, figure, footer, header, hgroup, keygen, meter, nav, output, progress, section, source, video {display:block;} 10 mark, rp, rt, ruby, summary, time {display:inline;} 11 input, textarea {border:0; padding:0; margin:0; outline: 0;} 12 iframe {border:0; margin:0; padding:0;} 13 input, textarea, select {margin:0; padding:0px;} 14 15 /* -------------------------------------------- */ 16 /* ------------------Font---------------------- */ 17 18 @import url(http://fonts.googleapis.com/css?family=Montserrat:400,700|Open+Sans:400,300,600,700); 19 20 /* -------------------------------------------- */ 21 /* ------------------Clear--------------------- */ 22 .clear{content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; } 23 24 article:after, article:before{clear: both; content: '\0020'; display: block; visibility: hidden; width: 0; height: 0;} 25 .box:after, .box:before{clear: both; content: '\0020'; display: block; visibility: hidden; width: 0; height: 0;} 26 27 /* -------------------------------------------- */ 28 /* ------------------Style--------------------- */ 29 html, body {width:100%; padding:0; margin:0;} 30 body {background: #F6F5F2;color: #474747; font-family: 'Montserrat', sans-serif; font-size: 16px; line-height: 25px;} 31 body .wrap-body{} 32 33 a{color: #444444;text-decoration: none;} 34 a:hover {color: #2ECC71; text-decoration: none;} 35 36 a.button{cursor: pointer;color: #ffffff;line-height: 14px;font-family: Arial, Helvetica, sans-serif;font-size: 14px;font-weight: bold; background: #2ECC71 ;} 37 a.button {display: inline-block; text-decoration: none; padding: 6px 12px 6px 12px;} 38 a.button:hover{} 39 40 h1,h2,h3,h4,h5,h6{ font-family: 'Montserrat', sans-serif; text-transform:uppercase; font-weight:700; line-height:1.4em; color: #474747; } 41 h1{ font-size:30px; } 42 h2{ font-size:25px; } 43 h3{ font-size:20px; } 44 h4{ font-size:18px; } 45 h5{ font-size:16px; } 46 h6{ font-size:14px; } 47 48 h1 a, h2 a, h3 a, h4 a{color: #474747; text-decoration: none;} 49 h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover{color: #2ECC71; text-decoration: none;} 50 51 /* -------------------------------------------- */ 52 /* ------------------Header-------------------- */ 53 header {background:#333333; margin-bottom:30px;} 54 header .wrap-header{height: 80px;} 55 56 header #logo {float: left; margin: 10px;} 57 58 /* -------------------------------------------- */ 59 /* ------------------Navigation---------------- */ 60 nav {} 61 nav .wrap-nav{float: right;} 62 63 .menu ul {list-style: none;margin: 0;padding: 0;} 64 .menu ul li {position: relative;float: left;padding: 28px 15px 21px 15px; background:#2ECC71;} 65 .menu ul li:hover {background-color:#ffffff;} 66 .menu ul li a {font-size: 14px; line-height:14px;color: #ffffff;display: block;padding: 6px 10px;margin-bottom: 5px;z-index: 6;position: relative;font-weight:bold; text-transform:uppercase;} 67 .menu ul li:hover a {color:#000000;} 68 69 /* -------------------------------------------- */ 70 /* ------------------Content------------------- */ 71 #content {} 72 #content .wrap-content{} 73 74 .block{} 75 76 #main-content{} 77 #main-content article {margin:10px 0px; background:#ffffff;} 78 #main-content article .heading{ padding: 30px 40px;} 79 #main-content article .heading .title{text-transform: uppercase; font-weight: bold;} 80 #main-content article .heading .title2{font-size: 16px; line-height: 20px;} 81 #main-content article img{display: inline-block; width: 100%;} 82 #main-content article .content{padding: 30px 40px;} 83 #main-content article p{margin-bottom:10px;} 84 #main-content article .extra{background: #2ECC71; padding: 10px 20px;} 85 #main-content article .more {float: right;} 86 #main-content article .info{float: left; color: #ffffff;} 87 #main-content article .info a{text-decoration: underline; color:#ffffff;} 88 89 #sidebar{} 90 #sidebar .box {margin-bottom:20px; background:#ffffff;} 91 #sidebar .box .heading { padding:20px; border-bottom:1px solid #EEEEEE;} 92 #sidebar .box .heading .title{text-transform: uppercase; font-size: 16px; font-weight: bold;} 93 #sidebar .box .content {padding:20px} 94 #sidebar .box .content .connect{} 95 #sidebar .box .content .last{border-bottom: 0px !important;} 96 #sidebar .box .content ul{ list-style-type:none;} 97 #sidebar .box .content ul li{border-bottom: 1px solid #EEEEEE; padding: 5px 0;} 98 #sidebar .box .content .post {padding-bottom: 10px; margin-bottom:10px; border-bottom: 1px solid #EEEEEE;} 99 #sidebar .box .content .post .title{ font-weight:normal; font-size: 16px; text-transform: none;} 100 #sidebar .box .content .post img{ float:left; margin:0 10px 10px 0;} 101 #sidebar .box .content .post p{color:#A3A3A3; font-style:italic;} 102 103 /* -------------------------------------------- */ 104 /* ------------------Form------------------- */ 105 #comment{padding: 30px 40px;} 106 107 #contact-form {width:500px;} 108 #contact-form label { 109 display:block; 110 height:44px; 111 } 112 #contact-form input { 113 width:100%; 114 font-size:15px; 115 line-height:1.2em; 116 color:#a0a0a0; 117 padding:8px 15px; 118 margin:0; 119 font-family:Arial, Helvetica, sans-serif; 120 border:1px solid #eeeeee; 121 background: #ffffff; 122 outline:none; 123 } 124 #contact-form textarea { 125 height:158px; 126 overflow:auto; 127 width:100%; 128 font-size:15px; 129 line-height:1.2em; 130 color:#a0a0a0; 131 padding:7px 15px; 132 margin:0; 133 font-family:Arial, Helvetica, sans-serif; 134 border:1px solid #eeeeee; 135 background: #ffffff; 136 outline:none; 137 } 138 .buttons {padding-top:17px; text-align:right} 139 .buttons a {margin-left:30px} 140 141 142 /* -------------------------------------------- */ 143 /* ------------------Footer-------------------- */ 144 footer {background-color:#333333; margin-top:30px;} 145 footer .wrap-footer{padding:10px 0px; color:#ffffff;} 146 footer .box .heading{ padding:5px; border-bottom:1px dotted #ffffff;} 147 footer .box .heading .title{padding:0 10px; color:#ffffff;} 148 footer .box .content{padding:20px} 149 footer .box .content a{ color: #ffffff; text-decoration: underline;} 150 footer .box .content a:hover {color: #2ECC71; text-decoration: none;} 151 footer .box .content p{margin-bottom: 10px;} 152 footer .box .content .gallery {} 153 footer .box .content .gallery img{} 154 155 .copyright{text-align:center; margin-top:20px; background:#000; padding:10px 0px;color:#ffffff; } 156 .copyright a{text-decoration:underline; color:#ffffff; }
zerogrid.css

1 /* 2 Zerotheme.com | Free Html5 Responsive Templates 3 Zerogrid - A Single Grid System for Responsive Design 4 Author: Kimmy 5 Version : 2.1 6 Author URI: http://www.zerotheme.com/ 7 */ 8 /* -------------------------------------------- */ 9 /* ------------------Grid System--------------- */ 10 .zerogrid{ width: 960px; position: relative; margin: 0 auto; padding: 0px;} 11 .zerogrid:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; } 12 13 .zerogrid .row{} 14 .zerogrid .row:before,.row:after { content: '\0020'; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } 15 .zerogrid .row:after{clear: both; } 16 .zerogrid .row{zoom: 1;} 17 18 .zerogrid .wrap-col{margin:10px;} 19 20 .zerogrid .col-1-2, .zerogrid .col-1-3, .zerogrid .col-2-3, .zerogrid .col-1-4, .zerogrid .col-2-4, .zerogrid .col-3-4, .zerogrid .col-1-5, .zerogrid .col-2-5, .zerogrid .col-3-5, .zerogrid .col-4-5, .zerogrid .col-1-6, .zerogrid .col-2-6, .zerogrid .col-3-6, .zerogrid .col-4-6, .zerogrid .col-5-6{float:left; display: inline-block;} 21 22 .zerogrid .col-full{width:100%;} 23 24 .zerogrid .col-1-2{width:50%;} 25 26 .zerogrid .col-1-3{width:33.33%;} 27 .zerogrid .col-2-3{width:66.66%;} 28 29 .zerogrid .col-1-4{width:25%;} 30 .zerogrid .col-2-4{width:50%;} 31 .zerogrid .col-3-4{width:75%;} 32 33 .zerogrid .col-1-5{width:20%;} 34 .zerogrid .col-2-5{width:40%;} 35 .zerogrid .col-3-5{width:60%;} 36 .zerogrid .col-4-5{width:80%;} 37 38 .zerogrid .col-1-6{width:16.66%;} 39 .zerogrid .col-2-6{width:33.33%;} 40 .zerogrid .col-3-6{width:50%;} 41 .zerogrid .col-4-6{width:66.66%;} 42 .zerogrid .col-5-6{width:83.33%;} 43 44 @media only screen and (min-width: 768px) and (max-width: 959px) { 45 .zerogrid{width:768px;} 46 } 47 48 @media only screen and (max-width: 767px) { 49 .zerogrid{width:100%;} 50 } 51 52 @media only screen and (min-width: 620px) and (max-width: 767px) { 53 .zerogrid{width:100%;} 54 } 55 56 @media only screen and (max-width: 619px) { 57 .zerogrid, .zerogrid .col-1-2, .zerogrid .col-1-3, .zerogrid .col-2-3, .zerogrid .col-1-4, .zerogrid .col-2-4, .zerogrid .col-3-4, .zerogrid .col-1-5, .zerogrid .col-2-5, .zerogrid .col-3-5, .zerogrid .col-4-5, .zerogrid .col-1-6, .zerogrid .col-2-6, .zerogrid .col-3-6, .zerogrid .col-4-6, .zerogrid .col-5-6{width:100%;} 58 }
css3-mediaqueries.js

1 if(typeof Object.create!=="function"){ 2 Object.create=function(o){ 3 function F(){ 4 }; 5 F.prototype=o; 6 return new F(); 7 }; 8 } 9 var ua={toString:function(){ 10 return navigator.userAgent; 11 },test:function(s){ 12 return this.toString().toLowerCase().indexOf(s.toLowerCase())>-1; 13 }}; 14 ua.version=(ua.toString().toLowerCase().match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1]; 15 ua.webkit=ua.test("webkit"); 16 ua.gecko=ua.test("gecko")&&!ua.webkit; 17 ua.opera=ua.test("opera"); 18 ua.ie=ua.test("msie")&&!ua.opera; 19 ua.ie6=ua.ie&&document.compatMode&&typeof document.documentElement.style.maxHeight==="undefined"; 20 ua.ie7=ua.ie&&document.documentElement&&typeof document.documentElement.style.maxHeight!=="undefined"&&typeof XDomainRequest==="undefined"; 21 ua.ie8=ua.ie&&typeof XDomainRequest!=="undefined"; 22 var domReady=function(){ 23 var _1=[]; 24 var _2=function(){ 25 if(!arguments.callee.done){ 26 arguments.callee.done=true; 27 for(var i=0;i<_1.length;i++){ 28 _1[i](); 29 } 30 } 31 }; 32 if(document.addEventListener){ 33 document.addEventListener("DOMContentLoaded",_2,false); 34 } 35 if(ua.ie){ 36 (function(){ 37 try{ 38 document.documentElement.doScroll("left"); 39 } 40 catch(e){ 41 setTimeout(arguments.callee,50); 42 return; 43 } 44 _2(); 45 })(); 46 document.onreadystatechange=function(){ 47 if(document.readyState==="complete"){ 48 document.onreadystatechange=null; 49 _2(); 50 } 51 }; 52 } 53 if(ua.webkit&&document.readyState){ 54 (function(){ 55 if(document.readyState!=="loading"){ 56 _2(); 57 }else{ 58 setTimeout(arguments.callee,10); 59 } 60 })(); 61 } 62 window.onload=_2; 63 return function(fn){ 64 if(typeof fn==="function"){ 65 _1[_1.length]=fn; 66 } 67 return fn; 68 }; 69 }(); 70 var cssHelper=function(){ 71 var _3={BLOCKS:/[^\s{][^{]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g}; 72 var _4,_5=false; 73 var _6=[]; 74 var _7=function(fn){ 75 if(typeof fn==="function"){ 76 _6[_6.length]=fn; 77 } 78 }; 79 var _8=function(){ 80 for(var i=0;i<_6.length;i++){ 81 _6[i](_4); 82 } 83 }; 84 var _9={}; 85 var _a=function(n,v){ 86 if(_9[n]){ 87 var _b=_9[n].listeners; 88 if(_b){ 89 for(var i=0;i<_b.length;i++){ 90 _b[i](v); 91 } 92 } 93 } 94 }; 95 var _c=function(_d,_e,_f){ 96 if(ua.ie&&!window.XMLHttpRequest){ 97 window.XMLHttpRequest=function(){ 98 return new ActiveXObject("Microsoft.XMLHTTP"); 99 }; 100 } 101 if(!XMLHttpRequest){ 102 return ""; 103 } 104 var r=new XMLHttpRequest(); 105 try{ 106 r.open("get",_d,true); 107 r.setRequestHeader("X_REQUESTED_WITH","XMLHttpRequest"); 108 } 109 catch(e){ 110 _f(); 111 return; 112 } 113 var _10=false; 114 setTimeout(function(){ 115 _10=true; 116 },5000); 117 document.documentElement.style.cursor="progress"; 118 r.onreadystatechange=function(){ 119 if(r.readyState===4&&!_10){ 120 if(!r.status&&location.protocol==="file:"||(r.status>=200&&r.status<300)||r.status===304||navigator.userAgent.indexOf("Safari")>-1&&typeof r.status==="undefined"){ 121 _e(r.responseText); 122 }else{ 123 _f(); 124 } 125 document.documentElement.style.cursor=""; 126 r=null; 127 } 128 }; 129 r.send(""); 130 }; 131 var _11=function(_12){ 132 _12=_12.replace(_3.REDUNDANT_COMPONENTS,""); 133 _12=_12.replace(_3.REDUNDANT_WHITESPACE,"$1"); 134 _12=_12.replace(_3.MORE_WHITESPACE," "); 135 _12=_12.replace(_3.FINAL_SEMICOLONS,"}"); 136 return _12; 137 }; 138 var _13={mediaQueryList:function(s){ 139 var o={}; 140 var idx=s.indexOf("{"); 141 var lt=s.substring(0,idx); 142 s=s.substring(idx+1,s.length-1); 143 var mqs=[],rs=[]; 144 var qts=lt.toLowerCase().substring(7).split(","); 145 for(var i=0;i<qts.length;i++){ 146 mqs[mqs.length]=_13.mediaQuery(qts[i],o); 147 } 148 var rts=s.match(_3.BLOCKS_INSIDE); 149 if(rts!==null){ 150 for(i=0;i<rts.length;i++){ 151 rs[rs.length]=_13.rule(rts[i],o); 152 } 153 } 154 o.getMediaQueries=function(){ 155 return mqs; 156 }; 157 o.getRules=function(){ 158 return rs; 159 }; 160 o.getListText=function(){ 161 return lt; 162 }; 163 o.getCssText=function(){ 164 return s; 165 }; 166 return o; 167 },mediaQuery:function(s,mql){ 168 s=s||""; 169 var not=false,_14; 170 var exp=[]; 171 var _15=true; 172 var _16=s.match(_3.NOT_WHITESPACE); 173 for(var i=0;i<_16.length;i++){ 174 var _17=_16[i]; 175 if(!_14&&(_17==="not"||_17==="only")){ 176 if(_17==="not"){ 177 not=true; 178 } 179 }else{ 180 if(!_14){ 181 _14=_17; 182 }else{ 183 if(_17.charAt(0)==="("){ 184 var _18=_17.substring(1,_17.length-1).split(":"); 185 exp[exp.length]={mediaFeature:_18[0],value:_18[1]||null}; 186 } 187 } 188 } 189 } 190 return {getList:function(){ 191 return mql||null; 192 },getValid:function(){ 193 return _15; 194 },getNot:function(){ 195 return not; 196 },getMediaType:function(){ 197 return _14; 198 },getExpressions:function(){ 199 return exp; 200 }}; 201 },rule:function(s,mql){ 202 var o={}; 203 var idx=s.indexOf("{"); 204 var st=s.substring(0,idx); 205 var ss=st.split(","); 206 var ds=[]; 207 var dts=s.substring(idx+1,s.length-1).split(";"); 208 for(var i=0;i<dts.length;i++){ 209 ds[ds.length]=_13.declaration(dts[i],o); 210 } 211 o.getMediaQueryList=function(){ 212 return mql||null; 213 }; 214 o.getSelectors=function(){ 215 return ss; 216 }; 217 o.getSelectorText=function(){ 218 return st; 219 }; 220 o.getDeclarations=function(){ 221 return ds; 222 }; 223 o.getPropertyValue=function(n){ 224 for(var i=0;i<ds.length;i++){ 225 if(ds[i].getProperty()===n){ 226 return ds[i].getValue(); 227 } 228 } 229 return null; 230 }; 231 return o; 232 },declaration:function(s,r){ 233 var idx=s.indexOf(":"); 234 var p=s.substring(0,idx); 235 var v=s.substring(idx+1); 236 return {getRule:function(){ 237 return r||null; 238 },getProperty:function(){ 239 return p; 240 },getValue:function(){ 241 return v; 242 }}; 243 }}; 244 var _19=function(el){ 245 if(typeof el.cssHelperText!=="string"){ 246 return; 247 } 248 var o={mediaQueryLists:[],rules:[],selectors:{},declarations:[],properties:{}}; 249 var _1a=o.mediaQueryLists; 250 var ors=o.rules; 251 var _1b=el.cssHelperText.match(_3.BLOCKS); 252 if(_1b!==null){ 253 for(var i=0;i<_1b.length;i++){ 254 if(_1b[i].substring(0,7)==="@media "){ 255 _1a[_1a.length]=_13.mediaQueryList(_1b[i]); 256 ors=o.rules=ors.concat(_1a[_1a.length-1].getRules()); 257 }else{ 258 ors[ors.length]=_13.rule(_1b[i]); 259 } 260 } 261 } 262 var oss=o.selectors; 263 var _1c=function(r){ 264 var ss=r.getSelectors(); 265 for(var i=0;i<ss.length;i++){ 266 var n=ss[i]; 267 if(!oss[n]){ 268 oss[n]=[]; 269 } 270 oss[n][oss[n].length]=r; 271 } 272 }; 273 for(i=0;i<ors.length;i++){ 274 _1c(ors[i]); 275 } 276 var ods=o.declarations; 277 for(i=0;i<ors.length;i++){ 278 ods=o.declarations=ods.concat(ors[i].getDeclarations()); 279 } 280 var ops=o.properties; 281 for(i=0;i<ods.length;i++){ 282 var n=ods[i].getProperty(); 283 if(!ops[n]){ 284 ops[n]=[]; 285 } 286 ops[n][ops[n].length]=ods[i]; 287 } 288 el.cssHelperParsed=o; 289 _4[_4.length]=el; 290 return o; 291 }; 292 var _1d=function(el,s){ 293 el.cssHelperText=_11(s||el.innerHTML); 294 return _19(el); 295 }; 296 var _1e=function(){ 297 _5=true; 298 _4=[]; 299 var _1f=[]; 300 var _20=function(){ 301 for(var i=0;i<_1f.length;i++){ 302 _19(_1f[i]); 303 } 304 var _21=document.getElementsByTagName("style"); 305 for(i=0;i<_21.length;i++){ 306 _1d(_21[i]); 307 } 308 _5=false; 309 _8(); 310 }; 311 var _22=document.getElementsByTagName("link"); 312 for(var i=0;i<_22.length;i++){ 313 var _23=_22[i]; 314 if(_23.getAttribute("rel").indexOf("style")>-1&&_23.href&&_23.href.length!==0&&!_23.disabled){ 315 _1f[_1f.length]=_23; 316 } 317 } 318 if(_1f.length>0){ 319 var c=0; 320 var _24=function(){ 321 c++; 322 if(c===_1f.length){ 323 _20(); 324 } 325 }; 326 var _25=function(_26){ 327 var _27=_26.href; 328 _c(_27,function(_28){ 329 _28=_11(_28).replace(_3.RELATIVE_URLS,"url("+_27.substring(0,_27.lastIndexOf("/"))+"/$1)"); 330 _26.cssHelperText=_28; 331 _24(); 332 },_24); 333 }; 334 for(i=0;i<_1f.length;i++){ 335 _25(_1f[i]); 336 } 337 }else{ 338 _20(); 339 } 340 }; 341 var _29={mediaQueryLists:"array",rules:"array",selectors:"object",declarations:"array",properties:"object"}; 342 var _2a={mediaQueryLists:null,rules:null,selectors:null,declarations:null,properties:null}; 343 var _2b=function(_2c,v){ 344 if(_2a[_2c]!==null){ 345 if(_29[_2c]==="array"){ 346 return (_2a[_2c]=_2a[_2c].concat(v)); 347 }else{ 348 var c=_2a[_2c]; 349 for(var n in v){ 350 if(v.hasOwnProperty(n)){ 351 if(!c[n]){ 352 c[n]=v[n]; 353 }else{ 354 c[n]=c[n].concat(v[n]); 355 } 356 } 357 } 358 return c; 359 } 360 } 361 }; 362 var _2d=function(_2e){ 363 _2a[_2e]=(_29[_2e]==="array")?[]:{}; 364 for(var i=0;i<_4.length;i++){ 365 _2b(_2e,_4[i].cssHelperParsed[_2e]); 366 } 367 return _2a[_2e]; 368 }; 369 domReady(function(){ 370 var els=document.body.getElementsByTagName("*"); 371 for(var i=0;i<els.length;i++){ 372 els[i].checkedByCssHelper=true; 373 } 374 if(document.implementation.hasFeature("MutationEvents","2.0")||window.MutationEvent){ 375 document.body.addEventListener("DOMNodeInserted",function(e){ 376 var el=e.target; 377 if(el.nodeType===1){ 378 _a("DOMElementInserted",el); 379 el.checkedByCssHelper=true; 380 } 381 },false); 382 }else{ 383 setInterval(function(){ 384 var els=document.body.getElementsByTagName("*"); 385 for(var i=0;i<els.length;i++){ 386 if(!els[i].checkedByCssHelper){ 387 _a("DOMElementInserted",els[i]); 388 els[i].checkedByCssHelper=true; 389 } 390 } 391 },1000); 392 } 393 }); 394 var _2f=function(d){ 395 if(typeof window.innerWidth!="undefined"){ 396 return window["inner"+d]; 397 }else{ 398 if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){ 399 return document.documentElement["client"+d]; 400 } 401 } 402 }; 403 return {addStyle:function(s,_30){ 404 var el=document.createElement("style"); 405 el.setAttribute("type","text/css"); 406 document.getElementsByTagName("head")[0].appendChild(el); 407 if(el.styleSheet){ 408 el.styleSheet.cssText=s; 409 }else{ 410 el.appendChild(document.createTextNode(s)); 411 } 412 el.addedWithCssHelper=true; 413 if(typeof _30==="undefined"||_30===true){ 414 cssHelper.parsed(function(_31){ 415 var o=_1d(el,s); 416 for(var n in o){ 417 if(o.hasOwnProperty(n)){ 418 _2b(n,o[n]); 419 } 420 } 421 _a("newStyleParsed",el); 422 }); 423 }else{ 424 el.parsingDisallowed=true; 425 } 426 return el; 427 },removeStyle:function(el){ 428 return el.parentNode.removeChild(el); 429 },parsed:function(fn){ 430 if(_5){ 431 _7(fn); 432 }else{ 433 if(typeof _4!=="undefined"){ 434 if(typeof fn==="function"){ 435 fn(_4); 436 } 437 }else{ 438 _7(fn); 439 _1e(); 440 } 441 } 442 },mediaQueryLists:function(fn){ 443 cssHelper.parsed(function(_32){ 444 fn(_2a.mediaQueryLists||_2d("mediaQueryLists")); 445 }); 446 },rules:function(fn){ 447 cssHelper.parsed(function(_33){ 448 fn(_2a.rules||_2d("rules")); 449 }); 450 },selectors:function(fn){ 451 cssHelper.parsed(function(_34){ 452 fn(_2a.selectors||_2d("selectors")); 453 }); 454 },declarations:function(fn){ 455 cssHelper.parsed(function(_35){ 456 fn(_2a.declarations||_2d("declarations")); 457 }); 458 },properties:function(fn){ 459 cssHelper.parsed(function(_36){ 460 fn(_2a.properties||_2d("properties")); 461 }); 462 },broadcast:_a,addListener:function(n,fn){ 463 if(typeof fn==="function"){ 464 if(!_9[n]){ 465 _9[n]={listeners:[]}; 466 } 467 _9[n].listeners[_9[n].listeners.length]=fn; 468 } 469 },removeListener:function(n,fn){ 470 if(typeof fn==="function"&&_9[n]){ 471 var ls=_9[n].listeners; 472 for(var i=0;i<ls.length;i++){ 473 if(ls[i]===fn){ 474 ls.splice(i,1); 475 i-=1; 476 } 477 } 478 } 479 },getViewportWidth:function(){ 480 return _2f("Width"); 481 },getViewportHeight:function(){ 482 return _2f("Height"); 483 }}; 484 }(); 485 domReady(function enableCssMediaQueries(){ 486 var _37; 487 var _38={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/}; 488 var _39=[]; 489 var _3a=function(){ 490 var id="css3-mediaqueries-test"; 491 var el=document.createElement("div"); 492 el.id=id; 493 var _3b=cssHelper.addStyle("@media all and (width) { #"+id+" { width: 1px !important; } }",false); 494 document.body.appendChild(el); 495 var ret=el.offsetWidth===1; 496 _3b.parentNode.removeChild(_3b); 497 el.parentNode.removeChild(el); 498 _3a=function(){ 499 return ret; 500 }; 501 return ret; 502 }; 503 var _3c=function(){ 504 _37=document.createElement("div"); 505 _37.style.cssText="position:absolute;top:-9999em;left:-9999em;"+"margin:0;border:none;padding:0;width:1em;font-size:1em;"; 506 document.body.appendChild(_37); 507 if(_37.offsetWidth!==16){ 508 _37.style.fontSize=16/_37.offsetWidth+"em"; 509 } 510 _37.style.width=""; 511 }; 512 var _3d=function(_3e){ 513 _37.style.width=_3e; 514 var _3f=_37.offsetWidth; 515 _37.style.width=""; 516 return _3f; 517 }; 518 var _40=function(_41,_42){ 519 var l=_41.length; 520 var min=(_41.substring(0,4)==="min-"); 521 var max=(!min&&_41.substring(0,4)==="max-"); 522 if(_42!==null){ 523 var _43; 524 var _44; 525 if(_38.LENGTH_UNIT.exec(_42)){ 526 _43="length"; 527 _44=_3d(_42); 528 }else{ 529 if(_38.RESOLUTION_UNIT.exec(_42)){ 530 _43="resolution"; 531 _44=parseInt(_42,10); 532 var _45=_42.substring((_44+"").length); 533 }else{ 534 if(_38.ASPECT_RATIO.exec(_42)){ 535 _43="aspect-ratio"; 536 _44=_42.split("/"); 537 }else{ 538 if(_38.ABSOLUTE_VALUE){ 539 _43="absolute"; 540 _44=_42; 541 }else{ 542 _43="unknown"; 543 } 544 } 545 } 546 } 547 } 548 var _46,_47; 549 if("device-width"===_41.substring(l-12,l)){ 550 _46=screen.width; 551 if(_42!==null){ 552 if(_43==="length"){ 553 return ((min&&_46>=_44)||(max&&_46<_44)||(!min&&!max&&_46===_44)); 554 }else{ 555 return false; 556 } 557 }else{ 558 return _46>0; 559 } 560 }else{ 561 if("device-height"===_41.substring(l-13,l)){ 562 _47=screen.height; 563 if(_42!==null){ 564 if(_43==="length"){ 565 return ((min&&_47>=_44)||(max&&_47<_44)||(!min&&!max&&_47===_44)); 566 }else{ 567 return false; 568 } 569 }else{ 570 return _47>0; 571 } 572 }else{ 573 if("width"===_41.substring(l-5,l)){ 574 _46=document.documentElement.clientWidth||document.body.clientWidth; 575 if(_42!==null){ 576 if(_43==="length"){ 577 return ((min&&_46>=_44)||(max&&_46<_44)||(!min&&!max&&_46===_44)); 578 }else{ 579 return false; 580 } 581 }else{ 582 return _46>0; 583 } 584 }else{ 585 if("height"===_41.substring(l-6,l)){ 586 _47=document.documentElement.clientHeight||document.body.clientHeight; 587 if(_42!==null){ 588 if(_43==="length"){ 589 return ((min&&_47>=_44)||(max&&_47<_44)||(!min&&!max&&_47===_44)); 590 }else{ 591 return false; 592 } 593 }else{ 594 return _47>0; 595 } 596 }else{ 597 if("device-aspect-ratio"===_41.substring(l-19,l)){ 598 return _43==="aspect-ratio"&&screen.width*_44[1]===screen.height*_44[0]; 599 }else{ 600 if("color-index"===_41.substring(l-11,l)){ 601 var _48=Math.pow(2,screen.colorDepth); 602 if(_42!==null){ 603 if(_43==="absolute"){ 604 return ((min&&_48>=_44)||(max&&_48<_44)||(!min&&!max&&_48===_44)); 605 }else{ 606 return false; 607 } 608 }else{ 609 return _48>0; 610 } 611 }else{ 612 if("color"===_41.substring(l-5,l)){ 613 var _49=screen.colorDepth; 614 if(_42!==null){ 615 if(_43==="absolute"){ 616 return ((min&&_49>=_44)||(max&&_49<_44)||(!min&&!max&&_49===_44)); 617 }else{ 618 return false; 619 } 620 }else{ 621 return _49>0; 622 } 623 }else{ 624 if("resolution"===_41.substring(l-10,l)){ 625 var res; 626 if(_45==="dpcm"){ 627 res=_3d("1cm"); 628 }else{ 629 res=_3d("1in"); 630 } 631 if(_42!==null){ 632 if(_43==="resolution"){ 633 return ((min&&res>=_44)||(max&&res<_44)||(!min&&!max&&res===_44)); 634 }else{ 635 return false; 636 } 637 }else{ 638 return res>0; 639 } 640 }else{ 641 return false; 642 } 643 } 644 } 645 } 646 } 647 } 648 } 649 } 650 }; 651 var _4a=function(mq){ 652 var _4b=mq.getValid(); 653 var _4c=mq.getExpressions(); 654 var l=_4c.length; 655 if(l>0){ 656 for(var i=0;i<l&&_4b;i++){ 657 _4b=_40(_4c[i].mediaFeature,_4c[i].value); 658 } 659 var not=mq.getNot(); 660 return (_4b&&!not||not&&!_4b); 661 } 662 }; 663 var _4d=function(mql){ 664 var mqs=mql.getMediaQueries(); 665 var t={}; 666 for(var i=0;i<mqs.length;i++){ 667 if(_4a(mqs[i])){ 668 t[mqs[i].getMediaType()]=true; 669 } 670 } 671 var s=[],c=0; 672 for(var n in t){ 673 if(t.hasOwnProperty(n)){ 674 if(c>0){ 675 s[c++]=","; 676 } 677 s[c++]=n; 678 } 679 } 680 if(s.length>0){ 681 _39[_39.length]=cssHelper.addStyle("@media "+s.join("")+"{"+mql.getCssText()+"}",false); 682 } 683 }; 684 var _4e=function(_4f){ 685 for(var i=0;i<_4f.length;i++){ 686 _4d(_4f[i]); 687 } 688 if(ua.ie){ 689 document.documentElement.style.display="block"; 690 setTimeout(function(){ 691 document.documentElement.style.display=""; 692 },0); 693 setTimeout(function(){ 694 cssHelper.broadcast("cssMediaQueriesTested"); 695 },100); 696 }else{ 697 cssHelper.broadcast("cssMediaQueriesTested"); 698 } 699 }; 700 var _50=function(){ 701 for(var i=0;i<_39.length;i++){ 702 cssHelper.removeStyle(_39[i]); 703 } 704 _39=[]; 705 cssHelper.mediaQueryLists(_4e); 706 }; 707 var _51=0; 708 var _52=function(){ 709 var _53=cssHelper.getViewportWidth(); 710 var _54=cssHelper.getViewportHeight(); 711 if(ua.ie){ 712 var el=document.createElement("div"); 713 el.style.position="absolute"; 714 el.style.top="-9999em"; 715 el.style.overflow="scroll"; 716 document.body.appendChild(el); 717 _51=el.offsetWidth-el.clientWidth; 718 document.body.removeChild(el); 719 } 720 var _55; 721 var _56=function(){ 722 var vpw=cssHelper.getViewportWidth(); 723 var vph=cssHelper.getViewportHeight(); 724 if(Math.abs(vpw-_53)>_51||Math.abs(vph-_54)>_51){ 725 _53=vpw; 726 _54=vph; 727 clearTimeout(_55); 728 _55=setTimeout(function(){ 729 if(!_3a()){ 730 _50(); 731 }else{ 732 cssHelper.broadcast("cssMediaQueriesTested"); 733 } 734 },500); 735 } 736 }; 737 window.onresize=function(){ 738 var x=window.onresize||function(){ 739 }; 740 return function(){ 741 x(); 742 _56(); 743 }; 744 }(); 745 }; 746 var _57=document.documentElement; 747 _57.style.marginLeft="-32767px"; 748 setTimeout(function(){ 749 _57.style.marginTop=""; 750 },20000); 751 return function(){ 752 if(!_3a()){ 753 cssHelper.addListener("newStyleParsed",function(el){ 754 _4e(el.cssHelperParsed.mediaQueryLists); 755 }); 756 cssHelper.addListener("cssMediaQueriesTested",function(){ 757 if(ua.ie){ 758 _57.style.width="1px"; 759 } 760 setTimeout(function(){ 761 _57.style.width=""; 762 _57.style.marginLeft=""; 763 },0); 764 cssHelper.removeListener("cssMediaQueriesTested",arguments.callee); 765 }); 766 _3c(); 767 _50(); 768 }else{ 769 _57.style.marginLeft=""; 770 } 771 _52(); 772 }; 773 }()); 774 try{ 775 document.execCommand("BackgroundImageCache",false,true); 776 } 777 catch(e){ 778 }
html5.js

1 /*! HTML5 Shiv vpre3.6 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 2 Uncompressed source: https://github.com/aFarkas/html5shiv */ 3 (function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){if(!l.shivMethods)return c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g;(function(){var c=b.createElement("a");c.innerHTML="<xyz></xyz>",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b)})(this,document)
sqlite:

1 /* 2 Navicat SQLite Data Transfer 3 4 Source Server : xysite 5 Source Server Version : 30714 6 Source Host : :0 7 8 Target Server Type : SQLite 9 Target Server Version : 30714 10 File Encoding : 65001 11 12 Date: 2014-09-11 16:50:57 13 */ 14 15 PRAGMA foreign_keys = OFF; 16 17 -- ---------------------------- 18 -- Table structure for auth_group 19 -- ---------------------------- 20 DROP TABLE IF EXISTS "main"."auth_group"; 21 CREATE TABLE "auth_group" ( 22 "id" integer NOT NULL PRIMARY KEY, 23 "name" varchar(80) NOT NULL UNIQUE 24 ); 25 26 -- ---------------------------- 27 -- Records of auth_group 28 -- ---------------------------- 29 30 -- ---------------------------- 31 -- Table structure for auth_group_permissions 32 -- ---------------------------- 33 DROP TABLE IF EXISTS "main"."auth_group_permissions"; 34 CREATE TABLE "auth_group_permissions" ( 35 "id" integer NOT NULL PRIMARY KEY, 36 "group_id" integer NOT NULL, 37 "permission_id" integer NOT NULL REFERENCES "auth_permission" ("id"), 38 UNIQUE ("group_id", "permission_id") 39 ); 40 41 -- ---------------------------- 42 -- Records of auth_group_permissions 43 -- ---------------------------- 44 45 -- ---------------------------- 46 -- Table structure for auth_permission 47 -- ---------------------------- 48 DROP TABLE IF EXISTS "main"."auth_permission"; 49 CREATE TABLE "auth_permission" ( 50 "id" integer NOT NULL PRIMARY KEY, 51 "name" varchar(50) NOT NULL, 52 "content_type_id" integer NOT NULL, 53 "codename" varchar(100) NOT NULL, 54 UNIQUE ("content_type_id", "codename") 55 ); 56 57 -- ---------------------------- 58 -- Records of auth_permission 59 -- ---------------------------- 60 INSERT INTO "main"."auth_permission" VALUES (1, 'Can add log entry', 1, 'add_logentry'); 61 INSERT INTO "main"."auth_permission" VALUES (2, 'Can change log entry', 1, 'change_logentry'); 62 INSERT INTO "main"."auth_permission" VALUES (3, 'Can delete log entry', 1, 'delete_logentry'); 63 INSERT INTO "main"."auth_permission" VALUES (4, 'Can add permission', 2, 'add_permission'); 64 INSERT INTO "main"."auth_permission" VALUES (5, 'Can change permission', 2, 'change_permission'); 65 INSERT INTO "main"."auth_permission" VALUES (6, 'Can delete permission', 2, 'delete_permission'); 66 INSERT INTO "main"."auth_permission" VALUES (7, 'Can add group', 3, 'add_group'); 67 INSERT INTO "main"."auth_permission" VALUES (8, 'Can change group', 3, 'change_group'); 68 INSERT INTO "main"."auth_permission" VALUES (9, 'Can delete group', 3, 'delete_group'); 69 INSERT INTO "main"."auth_permission" VALUES (10, 'Can add user', 4, 'add_user'); 70 INSERT INTO "main"."auth_permission" VALUES (11, 'Can change user', 4, 'change_user'); 71 INSERT INTO "main"."auth_permission" VALUES (12, 'Can delete user', 4, 'delete_user'); 72 INSERT INTO "main"."auth_permission" VALUES (13, 'Can add content type', 5, 'add_contenttype'); 73 INSERT INTO "main"."auth_permission" VALUES (14, 'Can change content type', 5, 'change_contenttype'); 74 INSERT INTO "main"."auth_permission" VALUES (15, 'Can delete content type', 5, 'delete_contenttype'); 75 INSERT INTO "main"."auth_permission" VALUES (16, 'Can add session', 6, 'add_session'); 76 INSERT INTO "main"."auth_permission" VALUES (17, 'Can change session', 6, 'change_session'); 77 INSERT INTO "main"."auth_permission" VALUES (18, 'Can delete session', 6, 'delete_session'); 78 INSERT INTO "main"."auth_permission" VALUES (19, 'Can add index_show', 7, 'add_index_show'); 79 INSERT INTO "main"."auth_permission" VALUES (20, 'Can change index_show', 7, 'change_index_show'); 80 INSERT INTO "main"."auth_permission" VALUES (21, 'Can delete index_show', 7, 'delete_index_show'); 81 INSERT INTO "main"."auth_permission" VALUES (22, 'Can add blog_show', 8, 'add_blog_show'); 82 INSERT INTO "main"."auth_permission" VALUES (23, 'Can change blog_show', 8, 'change_blog_show'); 83 INSERT INTO "main"."auth_permission" VALUES (24, 'Can delete blog_show', 8, 'delete_blog_show'); 84 85 -- ---------------------------- 86 -- Table structure for auth_user 87 -- ---------------------------- 88 DROP TABLE IF EXISTS "main"."auth_user"; 89 CREATE TABLE "auth_user" ( 90 "id" integer NOT NULL PRIMARY KEY, 91 "password" varchar(128) NOT NULL, 92 "last_login" datetime NOT NULL, 93 "is_superuser" bool NOT NULL, 94 "username" varchar(30) NOT NULL UNIQUE, 95 "first_name" varchar(30) NOT NULL, 96 "last_name" varchar(30) NOT NULL, 97 "email" varchar(75) NOT NULL, 98 "is_staff" bool NOT NULL, 99 "is_active" bool NOT NULL, 100 "date_joined" datetime NOT NULL 101 ); 102 103 -- ---------------------------- 104 -- Records of auth_user 105 -- ---------------------------- 106 INSERT INTO "main"."auth_user" VALUES (1, 'pbkdf2_sha256$12000$s0Ssk22L9nlZ$5iZMBChnuN1I430PGntcJ4CEcnhKgfI0VINasKapnwY=', '2014-09-10 07:18:41.078000', 1, 'root', '', '', 'admin@yeah.net', 1, 1, '2014-09-09 02:49:07.984000'); 107 108 -- ---------------------------- 109 -- Table structure for auth_user_groups 110 -- ---------------------------- 111 DROP TABLE IF EXISTS "main"."auth_user_groups"; 112 CREATE TABLE "auth_user_groups" ( 113 "id" integer NOT NULL PRIMARY KEY, 114 "user_id" integer NOT NULL, 115 "group_id" integer NOT NULL REFERENCES "auth_group" ("id"), 116 UNIQUE ("user_id", "group_id") 117 ); 118 119 -- ---------------------------- 120 -- Records of auth_user_groups 121 -- ---------------------------- 122 123 -- ---------------------------- 124 -- Table structure for auth_user_user_permissions 125 -- ---------------------------- 126 DROP TABLE IF EXISTS "main"."auth_user_user_permissions"; 127 CREATE TABLE "auth_user_user_permissions" ( 128 "id" integer NOT NULL PRIMARY KEY, 129 "user_id" integer NOT NULL, 130 "permission_id" integer NOT NULL REFERENCES "auth_permission" ("id"), 131 UNIQUE ("user_id", "permission_id") 132 ); 133 134 -- ---------------------------- 135 -- Records of auth_user_user_permissions 136 -- ---------------------------- 137 138 -- ---------------------------- 139 -- Table structure for blog_blog_show 140 -- ---------------------------- 141 DROP TABLE IF EXISTS "main"."blog_blog_show"; 142 CREATE TABLE "blog_blog_show" ( 143 "id" integer NOT NULL PRIMARY KEY, 144 "blog_title" varchar(200) NOT NULL, 145 "blog_contents" text NOT NULL, 146 "blog_user_id" integer NOT NULL REFERENCES "auth_user" ("id"), 147 "blog_datetime" datetime NOT NULL, 148 "blog_img_title" varchar(100) NOT NULL, 149 "blog_img_path" varchar(100) NOT NULL 150 ); 151 152 -- ---------------------------- 153 -- Records of blog_blog_show 154 -- ---------------------------- 155 INSERT INTO "main"."blog_blog_show" VALUES (1, 'QUIS MI COMMODO ET SUSCIPIT', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam viverra convallis auctor. Sed accumsan libero quis mi commodo et suscipit enim lacinia. Morbi rutrum vulputate est sed faucibus. Nulla sed nisl mauris, id tristique tortor. Sed iaculis dapibus urna nec dictum. Proin non enim odio. Proin vitae turpis libero, eget feugiat enim. Sed fringilla facilisis convallis. 156 157 Donec ullamcorper nulla non metus auctor fringilla. Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam. 158 159 Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean lacinia bibendum nulla sed consectetur.Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. Nulla vitae elit libero, a pharetra augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id elit non mi porta gravida at eget metus. Vestibulum id ligula porta felis euismod semper. Vestibulum id ligula porta felis euismod semper.', 1, '2014-09-09 09:07:45', 'QUIS MI COMMODO ET SUSCIPIT', 'xysite/static/upload/blog/img2.jpg'); 160 INSERT INTO "main"."blog_blog_show" VALUES (2, 'SED FRINGILLA FACILISIS CONVALLIS', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam viverra convallis auctor. Sed accumsan libero quis mi commodo et suscipit enim lacinia. Morbi rutrum vulputate est sed faucibus. Nulla sed nisl mauris, id tristique tortor. Sed iaculis dapibus urna nec dictum. Proin non enim odio. Proin vitae turpis libero, eget feugiat enim. Sed fringilla facilisis convallis. 161 162 Donec ullamcorper nulla non metus auctor fringilla. Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam. 163 164 Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean lacinia bibendum nulla sed consectetur.Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. Nulla vitae elit libero, a pharetra augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id elit non mi porta gravida at eget metus. Vestibulum id ligula porta felis euismod semper. Vestibulum id ligula porta felis euismod semper.', 1, '2014-09-09 09:12:07', 'SED FRINGILLA FACILISIS CONVALLIS', 'xysite/static/upload/blog/img3.jpg'); 165 INSERT INTO "main"."blog_blog_show" VALUES (3, 'CONSECTETUR ADIPISCING ELIT', 'CONSECTETUR ADIPISCING ELITCONSECTETUR ADIPISCING ELITCONSECTETUR ADIPISCING ELITCONSECTETUR ADIPISCING ELITCONSECTETUR ADIPISCING ELITCONSECTETUR ADIPISCING ELIT', 1, '2014-09-09 09:12:45', 'CONSECTETUR ADIPISCING ELIT', 'xysite/static/upload/blog/img4.jpg'); 166 INSERT INTO "main"."blog_blog_show" VALUES (6, '中國人的世界', '中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界', 1, '2014-09-10 01:43:57', '中國人的世界中國人的世界', 'xysite/static/upload/blog/0000000.jpg'); 167 INSERT INTO "main"."blog_blog_show" VALUES (7, '啦啦啦啦啦啦啦', '啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦', 1, '2014-09-10 08:12:57', '啦啦啦啦啦啦啦', 'xysite/static/upload/blog/2676886_88UKMDS9482T0031_1.jpg'); 168 INSERT INTO "main"."blog_blog_show" VALUES (8, '中國人的世界11111', '中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界中國人的世界', 1, '2014-09-11 03:44:47', '中國人的世界', 'xysite/static/upload/blog/404.jpg'); 169 170 -- ---------------------------- 171 -- Table structure for blog_index_show 172 -- ---------------------------- 173 DROP TABLE IF EXISTS "main"."blog_index_show"; 174 CREATE TABLE "blog_index_show" ( 175 "id" integer NOT NULL, 176 "show_contents" text NOT NULL, 177 "show_img_title" varchar(100) NOT NULL, 178 "show_datetime" datetime NOT NULL, 179 "show_img_path" varchar(100) NOT NULL, 180 PRIMARY KEY ("id" ASC) 181 ); 182 183 -- ---------------------------- 184 -- Records of blog_index_show 185 -- ---------------------------- 186 INSERT INTO "main"."blog_index_show" VALUES (1, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam viverra convallis auctor. Sed accumsan libero quis mi commodo et suscipit enim lacinia. Morbi rutrum vulputate est sed faucibus. Nulla sed nisl mauris, id tristique tortor. Sed iaculis dapibus urna nec dictum. Proin non enim odio. Proin vitae turpis libero, eget feugiat enim. Sed fringilla facilisis convallis.', '啊啊', '2014-09-09 06:26:11', 'xysite/static/upload/135839959977_3.jpg'); 187 INSERT INTO "main"."blog_index_show" VALUES (2, 'I am a Chinese!', 'Tomorrow', '2014-09-09 07:17:19', 'xysite/static/upload/3909162_085436056312_2_1.jpg'); 188 189 -- ---------------------------- 190 -- Table structure for django_admin_log 191 -- ---------------------------- 192 DROP TABLE IF EXISTS "main"."django_admin_log"; 193 CREATE TABLE "django_admin_log" ( 194 "id" integer NOT NULL PRIMARY KEY, 195 "action_time" datetime NOT NULL, 196 "user_id" integer NOT NULL, 197 "content_type_id" integer, 198 "object_id" text, 199 "object_repr" varchar(200) NOT NULL, 200 "action_flag" smallint unsigned NOT NULL, 201 "change_message" text NOT NULL 202 ); 203 204 -- ---------------------------- 205 -- Records of django_admin_log 206 -- ---------------------------- 207 INSERT INTO "main"."django_admin_log" VALUES (1, '2014-09-09 03:44:23.140000', 1, 7, 1, 'good', 1, ''); 208 INSERT INTO "main"."django_admin_log" VALUES (2, '2014-09-09 05:17:52.718000', 1, 7, 1, '發', 1, ''); 209 INSERT INTO "main"."django_admin_log" VALUES (3, '2014-09-09 06:26:50.906000', 1, 7, 1, '啊啊', 1, ''); 210 INSERT INTO "main"."django_admin_log" VALUES (4, '2014-09-09 07:24:22.109000', 1, 7, 2, 'Tomorrow', 1, ''); 211 INSERT INTO "main"."django_admin_log" VALUES (5, '2014-09-09 09:11:19.531000', 1, 8, 1, 'QUIS MI COMMODO ET SUSCIPIT', 1, ''); 212 INSERT INTO "main"."django_admin_log" VALUES (6, '2014-09-09 09:12:28.031000', 1, 8, 2, 'SED FRINGILLA FACILISIS CONVALLIS', 1, ''); 213 INSERT INTO "main"."django_admin_log" VALUES (7, '2014-09-09 09:12:50.781000', 1, 8, 3, 'CONSECTETUR ADIPISCING ELIT', 1, ''); 214 INSERT INTO "main"."django_admin_log" VALUES (8, '2014-09-10 01:36:13.921000', 1, 8, 4, 'admin', 1, ''); 215 INSERT INTO "main"."django_admin_log" VALUES (9, '2014-09-10 01:36:53.187000', 1, 8, 5, 'login', 1, ''); 216 INSERT INTO "main"."django_admin_log" VALUES (10, '2014-09-10 01:44:07.156000', 1, 8, 6, '中國人的世界', 1, ''); 217 INSERT INTO "main"."django_admin_log" VALUES (11, '2014-09-10 07:18:51.781000', 1, 8, 4, 'admin', 3, ''); 218 INSERT INTO "main"."django_admin_log" VALUES (12, '2014-09-10 07:19:07.734000', 1, 8, 5, 'login', 3, ''); 219 INSERT INTO "main"."django_admin_log" VALUES (13, '2014-09-10 08:13:10.171000', 1, 8, 7, '啦啦啦啦啦啦啦', 1, ''); 220 INSERT INTO "main"."django_admin_log" VALUES (14, '2014-09-11 03:45:42.328000', 1, 8, 8, '中國人的世界11111', 1, ''); 221 222 -- ---------------------------- 223 -- Table structure for django_content_type 224 -- ---------------------------- 225 DROP TABLE IF EXISTS "main"."django_content_type"; 226 CREATE TABLE "django_content_type" ( 227 "id" integer NOT NULL PRIMARY KEY, 228 "name" varchar(100) NOT NULL, 229 "app_label" varchar(100) NOT NULL, 230 "model" varchar(100) NOT NULL, 231 UNIQUE ("app_label", "model") 232 ); 233 234 -- ---------------------------- 235 -- Records of django_content_type 236 -- ---------------------------- 237 INSERT INTO "main"."django_content_type" VALUES (1, 'log entry', 'admin', 'logentry'); 238 INSERT INTO "main"."django_content_type" VALUES (2, 'permission', 'auth', 'permission'); 239 INSERT INTO "main"."django_content_type" VALUES (3, 'group', 'auth', 'group'); 240 INSERT INTO "main"."django_content_type" VALUES (4, 'user', 'auth', 'user'); 241 INSERT INTO "main"."django_content_type" VALUES (5, 'content type', 'contenttypes', 'contenttype'); 242 INSERT INTO "main"."django_content_type" VALUES (6, 'session', 'sessions', 'session'); 243 INSERT INTO "main"."django_content_type" VALUES (7, 'index_show', 'blog', 'index_show'); 244 INSERT INTO "main"."django_content_type" VALUES (8, 'blog_show', 'blog', 'blog_show'); 245 246 -- ---------------------------- 247 -- Table structure for django_session 248 -- ---------------------------- 249 DROP TABLE IF EXISTS "main"."django_session"; 250 CREATE TABLE "django_session" ( 251 "session_key" varchar(40) NOT NULL PRIMARY KEY, 252 "session_data" text NOT NULL, 253 "expire_date" datetime NOT NULL 254 ); 255 256 -- ---------------------------- 257 -- Records of django_session 258 -- ---------------------------- 259 INSERT INTO "main"."django_session" VALUES ('vf3s3d5a6x3dhwi90wjuvrh2v06wln82', 'YThiM2NmN2UzYThkMjFkMGEwYTFhN2UyZDZjYTU3ZGU0NTczMGQyYzp7Il9hdXRoX3VzZXJfYmFja2VuZCI6ImRqYW5nby5jb250cmliLmF1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kIiwiX2F1dGhfdXNlcl9pZCI6MX0=', '2014-09-23 03:40:58.359000'); 260 INSERT INTO "main"."django_session" VALUES ('5tqo1h38dth9l3kozqqdkloa11g3vwjx', 'YThiM2NmN2UzYThkMjFkMGEwYTFhN2UyZDZjYTU3ZGU0NTczMGQyYzp7Il9hdXRoX3VzZXJfYmFja2VuZCI6ImRqYW5nby5jb250cmliLmF1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kIiwiX2F1dGhfdXNlcl9pZCI6MX0=', '2014-09-24 07:18:41.171000'); 261 262 -- ---------------------------- 263 -- Table structure for _blog_index_show_old_20140909 264 -- ---------------------------- 265 DROP TABLE IF EXISTS "main"."_blog_index_show_old_20140909"; 266 CREATE TABLE "_blog_index_show_old_20140909" ( 267 "id" integer NOT NULL, 268 "show_contents" text NOT NULL, 269 "show_img_title" varchar(100), 270 "show_datetime" datetime, 271 "show_img_path" varchar(100) NOT NULL, 272 PRIMARY KEY ("id" ASC) 273 ); 274 275 -- ---------------------------- 276 -- Records of _blog_index_show_old_20140909 277 -- ---------------------------- 278 279 -- ---------------------------- 280 -- Indexes structure for table auth_group_permissions 281 -- ---------------------------- 282 CREATE INDEX "main"."auth_group_permissions_5f412f9a" 283 ON "auth_group_permissions" ("group_id" ASC); 284 CREATE INDEX "main"."auth_group_permissions_83d7f98b" 285 ON "auth_group_permissions" ("permission_id" ASC); 286 287 -- ---------------------------- 288 -- Indexes structure for table auth_permission 289 -- ---------------------------- 290 CREATE INDEX "main"."auth_permission_37ef4eb4" 291 ON "auth_permission" ("content_type_id" ASC); 292 293 -- ---------------------------- 294 -- Indexes structure for table auth_user_groups 295 -- ---------------------------- 296 CREATE INDEX "main"."auth_user_groups_5f412f9a" 297 ON "auth_user_groups" ("group_id" ASC); 298 CREATE INDEX "main"."auth_user_groups_6340c63c" 299 ON "auth_user_groups" ("user_id" ASC); 300 301 -- ---------------------------- 302 -- Indexes structure for table auth_user_user_permissions 303 -- ---------------------------- 304 CREATE INDEX "main"."auth_user_user_permissions_6340c63c" 305 ON "auth_user_user_permissions" ("user_id" ASC); 306 CREATE INDEX "main"."auth_user_user_permissions_83d7f98b" 307 ON "auth_user_user_permissions" ("permission_id" ASC); 308 309 -- ---------------------------- 310 -- Indexes structure for table blog_blog_show 311 -- ---------------------------- 312 CREATE INDEX "main"."blog_blog_show_8bd1f4cd" 313 ON "blog_blog_show" ("blog_user_id" ASC); 314 315 -- ---------------------------- 316 -- Indexes structure for table django_admin_log 317 -- ---------------------------- 318 CREATE INDEX "main"."django_admin_log_37ef4eb4" 319 ON "django_admin_log" ("content_type_id" ASC); 320 CREATE INDEX "main"."django_admin_log_6340c63c" 321 ON "django_admin_log" ("user_id" ASC); 322 323 -- ---------------------------- 324 -- Indexes structure for table django_session 325 -- ---------------------------- 326 CREATE INDEX "main"."django_session_b7b81f0c" 327 ON "django_session" ("expire_date" ASC);
分頁需要安裝:django-pagination-1.0.7.tar.gz
index.html

1 <!DOCTYPE html> 2 <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> 3 <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> 4 <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> 5 <!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> 6 <head> 7 8 <!-- Basic Page Needs 9 ================================================== --> 10 <meta charset="utf-8"> 11 <title>XY</title> 12 <meta name="description" content="XY content"> 13 <meta name="author" content="xy> 14 {% load pagination_tags %} 15 {% load staticfiles %} 16 <!-- Mobile Specific Metas --> 17 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 18 19 <!-- CSS 20 ================================================== --> 21 22 <link rel="stylesheet" href="{% static "css/styles.css"%}"> 23 <link rel="stylesheet" href="{% static "css/zerogrid.css"%}"> 24 25 <link rel="stylesheet" href="{% static "css/responsive.css"%}"> 26 27 <!--[if lt IE 8]> 28 <div style=' clear: both; text-align:center; position: relative;'> 29 <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"> 30 <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /> 31 </a> 32 </div> 33 <![endif]--> 34 <!--[if lt IE 9]> 35 <script src="{% static "js/html5.js"%}"></script> 36 <script src="{% static "js/css3-mediaqueries.js"%}"></script> 37 <![endif]--> 38 39 <link href="{% static "images/favicon.ico"%}" rel='icon' type='image/x-icon'/> 40 <style type="text/css"> 41 .current page{background-color:red;} 42 .page{display:block;width:40px;float:left;text-align:center;} 43 .page:hover{background-color:blue;} 44 45 .prev,.disabled,.next{display:block;float:left;width:100px;} 46 </style> 47 48 </head> 49 <body> 50 <div class="wrap-body"> 51 <!--Header--> 52 <header> 53 <div class="wrap-header zerogrid"> 54 <div id="logo"><a href="#"><img src="{% static "images/logo.png"%}"/></a></div> 55 <nav> 56 <div class="wrap-nav"> 57 <div class="menu"> 58 <ul> 59 <li><a href="index.html">Home</a></li> 60 <li><a href="blog.html">Blog</a></li> 61 <li><a href="blog.html">Gallery</a></li> 62 <li><a href="blog.html">About</a></li> 63 <li><a href="#">Contact</a></li> 64 </ul> 65 </div> 66 </div> 67 </nav> 68 </div> 69 </header> 70 71 <!---Content--> 72 <section id="content"> 73 <div class="wrap-content zerogrid"> 74 <div class="row block"> 75 <div id="main-content" class="col-2-3"> 76 {% block row_con%} 77 <div class="row"> 78 <div class="col-full"> 79 <div class="wrap-col"> 80 <article> 81 <div class="heading"><h2 class="title"><a href="#">{{ posts.show_img_title }}</a></h2></div> 82 <!-- <img src="{% static "images/img1.jpg"%}"/> --> 83 <img src="{% static set_urls %}" alt="{{ posts.show_img_title }}"/> 84 <div class="content"> 85 {{ posts.show_contents }} 86 <!-- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam viverra convallis auctor. Sed accumsan libero quis mi commodo et suscipit enim lacinia. Morbi rutrum vulputate est sed faucibus. Nulla sed nisl mauris, id tristique tortor. Sed iaculis dapibus urna nec dictum. Proin non enim odio. Proin vitae turpis libero, eget feugiat enim. Sed fringilla facilisis convallis.</p> 87 --> 88 </div> 89 <div class="extra"> 90 <div class="info">By Admin on {{posts.show_datetime}}- <a href="#">01 Commnets</a></div> 91 <div class="more"><a class="button" href="#">Read more >></a></div> 92 <div class="clear"></div> 93 </div> 94 </article> 95 </div> 96 </div> 97 </div> 98 {% autopaginate forms 4 %} 99 {% for fom in forms %} 100 <div class="row"> 101 <div class="col-full"> 102 <!-- <div class="col-1-2"> --> 103 <div class="col-full"> 104 <!--<div class="wrap-col">--> 105 <article> 106 <div class="heading"><h2 class="title2"><a href="#">{{ fom.blog_title }}</a></h2></div> 107 <img src="{% static fom.blog_img_path%}" alt="{{ fom.blog_img_title }}"/> 108 <div class="extra"> 109 <div class="info"><a href="#">{{ fom.blog_img_title }}</a></div> 110 <div class="more"><a class="button" href="#">Read more >></a></div> 111 <div class="clear"></div> 112 </div> 113 </article> 114 </div> 115 </div> 116 </div> 117 {% endfor %} 118 {% paginate %} 119 {% endblock %} 120 </div> 121 <div id="sidebar" class="col-1-3"> 122 <div class="wrap-col"> 123 <div class="box"> 124 <div class="heading"><h4 class="title">Connect Us</h4></div> 125 <div class="content"> 126 <div class="connect"> 127 <a href="#"><img src="{% static "images/socials/facebook-icon.png"%}" title="facebook"/></a> 128 <a href="#"><img src="{% static "images/socials/google-plus-icon.png"%}" title="google plus"/></a> 129 <a href="#"><img src="{% static "images/socials/twitter-icon.png"%}" title="twitter" /></a> 130 <a href="#"><img src="{% static "images/socials/pinterest-icon.png"%}" title="pin"/></a> 131 <a href="#"><img src="{% static "images/socials/rss-icon.png"%}" title="rss"/></a> 132 </div> 133 </div> 134 </div> 135 <div class="box"> 136 <div class="heading"><h4 class="title">Popular Post</h4></div> 137 <div class="content"> 138 <div class="post"> 139 <img src="{% static "images/img2.jpg"%}"/> 140 <h5 class="title"><a href="#">Lorem ipsum dolor sit amet</a></h5> 141 </div> 142 <div class="post last"> 143 <img src="{% static "images/img4.jpg"%}"/> 144 <h5 class="title"><a href="#">Lorem ipsum dolor sit amet</a></h5> 145 </div> 146 </div> 147 </div> 148 <div class="box"> 149 <div class="heading"><h4 class="title">Categories</h4></div> 150 <div class="content"> 151 <ul> 152 <li><a href="#">Free Html5 Templates</a></li> 153 <li><a href="#">Free Responsive Themes</a></li> 154 <li><a href="#">Free Html5 and Css3 Themes</a></li> 155 <li><a href="#">Free Responsive Html5 and Css3 Themes</a></li> 156 <li><a href="#">Free Basic Responsive Html5 Css3 Layouts</a></li> 157 <li class="last"><a href="#">Premium Responsive Html5 Css3 Templates</a></li> 158 </ul> 159 </div> 160 </div> 161 <div class="box"> 162 <div class="heading"><h4 class="title">Random Post</h4></div> 163 <div class="content"> 164 <div class="post"> 165 <img src="{% static "images/img1[thumb].jpg"%}"/> 166 <h5 class="title"><a href="#">Lorem ipsum dolor sit amet</a></h5> 167 <p>November 11 ,2012</p> 168 </div> 169 <div class="post"> 170 <img src="{% static "images/img3[thumb].jpg"%}"/> 171 <h5 class="title"><a href="#">Lorem ipsum dolor sit amet</a></h5> 172 <p>November 11 ,2012</p> 173 </div> 174 <div class="post last"> 175 <img src="{% static "images/img5[thumb].jpg"%}"/> 176 <h5 class="title"><a href="#">Lorem ipsum dolor sit amet</a></h5> 177 <p>November 11 ,2012</p> 178 </div> 179 </div> 180 </div> 181 </div> 182 </div> 183 </div> 184 </div> 185 186 </section> 187 188 <!--Footer--> 189 <footer> 190 <div class="wrap-footer zerogrid"> 191 <div class="row"> 192 <div class="col-1-3"> 193 <div class="wrap-col"> 194 <div class="box"> 195 <div class="heading"><h4 class="title">Image Gallery</h4></div> 196 <div class="content gallery"> 197 <a href="#"><img src="{% static "images/img5.jpg"%}" width="120"/></a> 198 <a href="#"><img src="{% static "images/img4.jpg"%}" width="120"/></a> 199 <a href="#"><img src="{% static "images/img3.jpg"%}" width="120"/></a> 200 <a href="#"><img src="{% static "images/img2.jpg"%}" width="120"/></a> 201 <a href="#"><img src="{% static "images/img1.jpg"%}" width="120"/></a> 202 <a href="#"><img src="{% static "images/img4.jpg"%}" width="120"/></a> 203 </div> 204 </div> 205 </div> 206 </div> 207 <div class="col-1-3"> 208 <div class="wrap-col"> 209 <div class="box"> 210 <div class="heading"><h4 class="title">About Us</h4></div> 211 <div class="content"> 212 <a href="#" target="_blank"><img src="{% static "images/logo.png"%}" style="border: 0px; margin: 10px 0;"/></a> 213 <p><a href="#" target="_blank">This is my first site.</a> created by <a href="#">XY</a>. You can use and modify the template for both personal and commercial use. You must keep all copyright information and credit links in the template and associated files.</p> 214 </div> 215 </div> 216 </div> 217 </div> 218 <div class="col-1-3"> 219 <div class="wrap-col"> 220 <div class="box"> 221 <div class="heading"><h4 class="title">Contact Us</h4></div> 222 <div class="content"> 223 <p>It was designed by engineer Xiyang</p> 224 <p>Email: <a href="#" target="_blank">xiyang1081@gmail.com</a></p> 225 <p>Phone: (+86) 7758521 <br/> +1 (123) 444-5678</p> 226 <p>Address: China </p> 227 </div> 228 </div> 229 </div> 230 </div> 231 </div> 232 </div> 233 <div class="copyright"> 234 <p>© Copyright © 2014.Company name All rights reserved.<a target="_blank" href="#">XY</a></p> 235 </div> 236 </footer> 237 238 </div> 239 </body></html>
blogshow.html

1 <title>blog</title> 2 {% extends 'blog\index.html'%} 3 <!--------------Content---------------> 4 {% block row_con%} 5 <div class="row"> 6 <div class="col-full"> 7 <div class="wrap-col"> 8 <article> 9 <div class="heading"> 10 <h1 class="title"><a href="#">Lorem ipsum dolor sit amet</a></h2></div> 11 <img src="images/img1.jpg"/> 12 <div class="content"> 13 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam viverra convallis auctor. Sed accumsan libero quis mi commodo et suscipit enim lacinia. Morbi rutrum vulputate est sed faucibus. Nulla sed nisl mauris, id tristique tortor. Sed iaculis dapibus urna nec dictum. Proin non enim odio. Proin vitae turpis libero, eget feugiat enim. Sed fringilla facilisis convallis.</p> 14 <p>Donec ullamcorper nulla non metus auctor fringilla. Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam.</p> 15 <p>Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean lacinia bibendum nulla sed consectetur.Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. Nulla vitae elit libero, a pharetra augue. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id elit non mi porta gravida at eget metus. Vestibulum id ligula porta felis euismod semper. Vestibulum id ligula porta felis euismod semper.</p> 16 </div> 17 <div class="extra"> 18 <div class="info">By Admin on December 01, 2014 - <a href="#">01 Commnets</a></div> 19 <div class="clear"></div> 20 </div> 21 <div id="comment"> 22 <h3>Leave a Comment</h3> 23 24 <form id="contact-form" method="post"> 25 <fieldset> 26 <label><input name="email" value="Email" onBlur="if(this.value=='') this.value='Email'" onFocus="if(this.value =='Email' ) this.value=''" /></label> 27 <label><input name="subject" value="Subject" onBlur="if(this.value=='') this.value='Subject'" onFocus="if(this.value =='Subject' ) this.value=''" /></label> 28 <textarea onBlur="if(this.value=='') this.value='Message'" onFocus="if(this.value =='Message' ) this.value=''">Message</textarea> 29 <div class="buttons"> 30 <a href="#" onClick="document.getElementById('contact-form').reset()">Clear</a> 31 <a href="#" onClick="document.getElementById('contact-form').submit()">Send</a> 32 </div> 33 </fieldset> 34 </form> 35 </div> 36 </article> 37 </div> 38 </div> 39 </div> 40 {% endblock %}