parent
d6d6fcd5b7
commit
9b5314c512
@ -0,0 +1,6 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import BlogUser
|
||||
|
||||
admin.site.register(BlogUser)
|
||||
@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class AccountsConfig(AppConfig):
|
||||
name = 'accounts'
|
||||
@ -0,0 +1,48 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.2 on 2016-11-02 12:49
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import django.contrib.auth.models
|
||||
import django.contrib.auth.validators
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('auth', '0008_alter_user_username_max_length'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='BlogUser',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('password', models.CharField(max_length=128, verbose_name='password')),
|
||||
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
|
||||
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
|
||||
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
|
||||
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
|
||||
('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
|
||||
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
|
||||
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
|
||||
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
|
||||
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
|
||||
('nickname', models.CharField(blank=True, max_length=50, verbose_name='昵称')),
|
||||
('mugshot', models.ImageField(blank=True, upload_to='upload/mugshots', verbose_name='头像')),
|
||||
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
|
||||
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'users',
|
||||
'abstract': False,
|
||||
'verbose_name': 'user',
|
||||
},
|
||||
managers=[
|
||||
('objects', django.contrib.auth.models.UserManager()),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,8 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class BlogUser(AbstractUser):
|
||||
nickname = models.CharField('昵称', max_length=50, blank=True)
|
||||
mugshot = models.ImageField('头像', upload_to='upload/mugshots', blank=True)
|
||||
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
@ -1,3 +1,8 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import Article,Category,Tag
|
||||
|
||||
admin.site.register(Article)
|
||||
admin.site.register(Category)
|
||||
admin.site.register(Tag)
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.2 on 2016-11-02 12:49
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('comments', '0001_initial'),
|
||||
('blog', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='article',
|
||||
name='comment',
|
||||
field=models.ManyToManyField(blank=True, to='comments.Comment', verbose_name='评论集合'),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Black & White</title>
|
||||
|
||||
<!-- meta -->
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- css -->
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="css/pace.css">
|
||||
<link rel="stylesheet" href="css/custom.css">
|
||||
|
||||
<!-- js -->
|
||||
<script src="js/jquery-2.1.3.min.js"></script>
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
<script src="js/pace.min.js"></script>
|
||||
<script src="js/modernizr.custom.js"></script>
|
||||
</head>
|
||||
|
||||
<body id="page">
|
||||
<div class="container">
|
||||
<header id="site-header">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-5 col-xs-8">
|
||||
<div class="logo">
|
||||
<h1><a href="index.html"><b>Black</b> & White</a></h1>
|
||||
</div>
|
||||
</div><!-- col-md-4 -->
|
||||
<div class="col-md-8 col-sm-7 col-xs-4">
|
||||
<nav class="main-nav" role="navigation">
|
||||
<div class="navbar-header">
|
||||
<button type="button" id="trigger-overlay" class="navbar-toggle">
|
||||
<span class="ion-navicon"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="cl-effect-11"><a href="index.html" data-hover="Home">Home</a></li>
|
||||
<li class="cl-effect-11"><a href="full-width.html" data-hover="Blog">Blog</a></li>
|
||||
<li class="cl-effect-11"><a href="about.html" data-hover="About">About</a></li>
|
||||
<li class="cl-effect-11"><a href="contact.html" data-hover="Contact">Contact</a></li>
|
||||
</ul>
|
||||
</div><!-- /.navbar-collapse -->
|
||||
</nav>
|
||||
<div id="header-search-box">
|
||||
<a id="search-menu" href="#"><span id="search-icon" class="ion-ios-search-strong"></span></a>
|
||||
<div id="search-form" class="search-form">
|
||||
<form role="search" method="get" id="searchform" action="#">
|
||||
<input type="search" placeholder="Search" required>
|
||||
<button type="submit"><span class="ion-ios-search-strong"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- col-md-8 -->
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<div class="content-body">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<main class="col-md-12">
|
||||
<h1 class="page-title">Contact</h1>
|
||||
<article class="post">
|
||||
<div class="entry-content clearfix">
|
||||
<form action="#" method="post" class="contact-form">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<input type="text" name="name" placeholder="Name" required>
|
||||
<input type="email" name="email" placeholder="Email" required>
|
||||
<input type="text" name="subject" placeholder="Subject" required>
|
||||
<textarea name="message" rows="7" placeholder="Your Message" required></textarea>
|
||||
<button class="btn-send btn-5 btn-5b ion-ios-paperplane"><span>Drop Me a Line</span></button>
|
||||
</div>
|
||||
</div> <!-- row -->
|
||||
</form>
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer id="site-footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="copyright">© 2014 ThemeWagon.com</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Mobile Menu -->
|
||||
<div class="overlay overlay-hugeinc">
|
||||
<button type="button" class="overlay-close"><span class="ion-ios-close-empty"></span></button>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="index.html">Home</a></li>
|
||||
<li><a href="full-width.html">Blog</a></li>
|
||||
<li><a href="about.html">About</a></li>
|
||||
<li><a href="contact.html">Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<script src="js/script.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,804 @@
|
||||
|
||||
|
||||
/**
|
||||
* Table of Contents
|
||||
*
|
||||
* 1.0 - Google Font
|
||||
* 2.0 - General Elements
|
||||
* 3.0 - Site Header
|
||||
* 3.1 - Logo
|
||||
* 3.2 - Main Navigation
|
||||
* 3.2.1 - Main Nav CSS 3 Hover Effect
|
||||
* 4.0 - Home/Blog
|
||||
* 4.1 - Read More Button CSS 3 style
|
||||
* 5.0 - Widget
|
||||
* 6.0 - Footer
|
||||
* 7.0 - Header Search Bar
|
||||
* 8.0 - Mobile Menu
|
||||
* 9.0 - Contact Page Social
|
||||
* 10.0 - Contact Form
|
||||
* 11.0 - Media Query
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1.0 - Google Font
|
||||
*/
|
||||
|
||||
|
||||
@import url(http://fonts.useso.com/css?family=Lato:300,400);
|
||||
@import url(http://fonts.useso.com/css?family=Ubuntu:300,400);
|
||||
|
||||
/**
|
||||
* 2.0 - General Elements
|
||||
*/
|
||||
|
||||
* {outline: none;}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
b {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
a:hover, a:focus {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
body {
|
||||
color: #444;
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
|
||||
p {
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: 400;
|
||||
word-spacing: 1px;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
#single p,
|
||||
#page p {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.img-responsive-center img {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.height-40px {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3.0 - Site Header
|
||||
*/
|
||||
|
||||
#site-header {
|
||||
background-color: #FFF;
|
||||
padding: 25px 20px;
|
||||
margin-bottom: 40px;
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
}
|
||||
.copyrights{text-indent:-9999px;height:0;line-height:0;font-size:0;overflow:hidden;}
|
||||
|
||||
/**
|
||||
* 3.1 - Logo
|
||||
*/
|
||||
|
||||
.logo h1 a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.logo h1 a:hover {
|
||||
text-decoration: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.logo h1 {
|
||||
margin: 0;
|
||||
font-family: 'Lato', sans-serif;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3.2 - Main Navigation
|
||||
*/
|
||||
|
||||
.main-nav {
|
||||
margin-top: 11px;
|
||||
max-width: 95%;
|
||||
}
|
||||
|
||||
.main-nav a {
|
||||
color: #000000 !important;
|
||||
padding: 0 0 5px 0 !important;
|
||||
margin-right: 30px;
|
||||
font-family: 'Lato', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.main-nav a:active,
|
||||
.main-nav a:focus,
|
||||
.main-nav a:hover {
|
||||
background-color: transparent !important;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.navbar-toggle {
|
||||
margin: 0;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
.navbar-toggle span {
|
||||
font-size: 2em;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3.2.1 - Main Nav CSS 3 Hover Effect
|
||||
*/
|
||||
|
||||
.cl-effect-11 a {
|
||||
padding: 10px 0;
|
||||
color: #0972b4;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.cl-effect-11 a::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
padding: 0 0 5px 0 !important;
|
||||
max-width: 0;
|
||||
border-bottom: 1px solid #000;
|
||||
color: #000;
|
||||
content: attr(data-hover);
|
||||
-webkit-transition: max-width 0.5s;
|
||||
-moz-transition: max-width 0.5s;
|
||||
transition: max-width 0.5s;
|
||||
}
|
||||
|
||||
.cl-effect-11 a:hover::before,
|
||||
.cl-effect-11 a:focus::before {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.0 - Home/Blog
|
||||
*/
|
||||
|
||||
.content-body {
|
||||
padding-bottom: 4em;
|
||||
}
|
||||
|
||||
.post {
|
||||
background: #fff;
|
||||
padding: 30px 30px 0;
|
||||
}
|
||||
|
||||
.entry-title {
|
||||
text-align: center;
|
||||
font-size: 1.9em;
|
||||
margin-bottom: 20px;
|
||||
line-height: 1.6;
|
||||
padding: 10px 20px 0;
|
||||
}
|
||||
|
||||
.entry-meta {
|
||||
text-align: center;
|
||||
color: #DDDDDD;
|
||||
font-size: 13px;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.entry-content {
|
||||
font-size: 18px;
|
||||
line-height: 1.9;
|
||||
font-weight: 300;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.post-category,
|
||||
.post-date,
|
||||
.post-author {
|
||||
position: relative;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.post-category::after,
|
||||
.post-date::after,
|
||||
.post-author::after {
|
||||
position: absolute;
|
||||
content: '.';
|
||||
color: #000;
|
||||
font-size: 30px;
|
||||
top: -22px;
|
||||
right: 1px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.1 - Read More Button CSS 3 style
|
||||
*/
|
||||
|
||||
.read-more {
|
||||
font-family: 'Ubuntu', sans-serif;
|
||||
font-weight: 400;
|
||||
word-spacing: 1px;
|
||||
letter-spacing: 0.01em;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.cl-effect-14 a {
|
||||
padding: 0 20px;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin: 15px 25px;
|
||||
letter-spacing: 1px;
|
||||
font-weight: 400;
|
||||
text-shadow: 0 0 1px rgba(255,255,255,0.3);
|
||||
}
|
||||
|
||||
.cl-effect-14 a::before,
|
||||
.cl-effect-14 a::after {
|
||||
position: absolute;
|
||||
width: 45px;
|
||||
height: 1px;
|
||||
background: #C3C3C3;
|
||||
content: '';
|
||||
-webkit-transition: all 0.3s;
|
||||
-moz-transition: all 0.3s;
|
||||
transition: all 0.3s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.cl-effect-14 a::before {
|
||||
top: 0;
|
||||
left: 0;
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
-webkit-transform-origin: 0 0;
|
||||
-moz-transform-origin: 0 0;
|
||||
transform-origin: 0 0;
|
||||
}
|
||||
|
||||
.cl-effect-14 a::after {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
-webkit-transform: rotate(90deg);
|
||||
-moz-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
-webkit-transform-origin: 100% 0;
|
||||
-moz-transform-origin: 100% 0;
|
||||
transform-origin: 100% 0;
|
||||
}
|
||||
|
||||
.cl-effect-14 a:hover::before,
|
||||
.cl-effect-14 a:hover::after,
|
||||
.cl-effect-14 a:focus::before,
|
||||
.cl-effect-14 a:focus::after {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.cl-effect-14 a:hover::before,
|
||||
.cl-effect-14 a:focus::before {
|
||||
left: 50%;
|
||||
-webkit-transform: rotate(0deg) translateX(-50%);
|
||||
-moz-transform: rotate(0deg) translateX(-50%);
|
||||
transform: rotate(0deg) translateX(-50%);
|
||||
}
|
||||
|
||||
.cl-effect-14 a:hover::after,
|
||||
.cl-effect-14 a:focus::after {
|
||||
right: 50%;
|
||||
-webkit-transform: rotate(0deg) translateX(50%);
|
||||
-moz-transform: rotate(0deg) translateX(50%);
|
||||
transform: rotate(0deg) translateX(50%);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 5.0 - Widget
|
||||
*/
|
||||
|
||||
.widget {
|
||||
background: #fff;
|
||||
padding: 30px 0 0;
|
||||
}
|
||||
|
||||
.widget-title {
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 20px;
|
||||
line-height: 1.6;
|
||||
padding: 10px 0 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.widget-recent-posts ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.widget-recent-posts ul li {
|
||||
list-style-type: none;
|
||||
position: relative;
|
||||
line-height: 170%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.widget-recent-posts ul li::before {
|
||||
content: '\f3d3';
|
||||
font-family: "Ionicons";
|
||||
position: absolute;
|
||||
left: -17px;
|
||||
top: 3px;
|
||||
font-size: 16px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.widget-archives ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.widget-archives ul li {
|
||||
list-style-type: none;
|
||||
position: relative;
|
||||
line-height: 170%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.widget-archives ul li::before {
|
||||
content: '\f3f3';
|
||||
font-family: "Ionicons";
|
||||
position: absolute;
|
||||
left: -25px;
|
||||
top: 1px;
|
||||
font-size: 16px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.widget-category ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
.widget-category ul li {
|
||||
list-style-type: none;
|
||||
position: relative;
|
||||
line-height: 170%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.widget-category ul li::before {
|
||||
content: '\f3fe';
|
||||
font-family: "Ionicons";
|
||||
position: absolute;
|
||||
left: -25px;
|
||||
top: 1px;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* 6.0 - Footer
|
||||
*/
|
||||
|
||||
#site-footer {
|
||||
padding-top: 10px;
|
||||
padding: 0 0 1.5em 0;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
padding-top: 1em;
|
||||
margin: 0;
|
||||
border-top: 1px solid #eee;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/**
|
||||
* 7.0 - Header Search Bar
|
||||
*/
|
||||
|
||||
#header-search-box {
|
||||
position: absolute;
|
||||
right: 38px;
|
||||
top: 8px;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: none;
|
||||
width: 25%;
|
||||
position: absolute;
|
||||
min-width: 200px;
|
||||
right: -6px;
|
||||
top: 33px;
|
||||
}
|
||||
|
||||
#search-menu span {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#searchform {
|
||||
position: relative;
|
||||
border: 1px solid #ddd;
|
||||
min-height: 42px;
|
||||
}
|
||||
|
||||
#searchform input[type=search] {
|
||||
width: 100%;
|
||||
border: none;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
padding: 10px 30px 10px 10px;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
#searchform button {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 4px;
|
||||
z-index: 999;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#searchform button span {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
#search-menu span.ion-ios-close-empty {
|
||||
font-size: 40px;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
top: -6px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 8.0 - Mobile Menu
|
||||
*/
|
||||
|
||||
.overlay {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.overlay .overlay-close {
|
||||
position: absolute;
|
||||
right: 25px;
|
||||
top: 10px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
color: transparent;
|
||||
background-color: transparent;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.overlay-hugeinc.open .ion-ios-close-empty {
|
||||
color: #000;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.overlay nav {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
height: 60%;
|
||||
font-size: 54px;
|
||||
-webkit-transform: translateY(-50%);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.overlay ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.overlay ul li {
|
||||
display: block;
|
||||
height: 20%;
|
||||
height: calc(100% / 5);
|
||||
min-height: 54px;
|
||||
}
|
||||
|
||||
.overlay ul li a {
|
||||
font-weight: 300;
|
||||
display: block;
|
||||
-webkit-transition: color 0.2s;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.overlay ul li a:hover,
|
||||
.overlay ul li a:focus {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.overlay-hugeinc {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
}
|
||||
|
||||
.overlay-hugeinc.open {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
-webkit-transition: opacity 0.5s;
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
|
||||
.overlay-hugeinc nav {
|
||||
-webkit-perspective: 1200px;
|
||||
perspective: 1200px;
|
||||
}
|
||||
|
||||
.overlay-hugeinc nav ul {
|
||||
opacity: 0.4;
|
||||
-webkit-transform: translateY(-25%) rotateX(35deg);
|
||||
transform: translateY(-25%) rotateX(35deg);
|
||||
-webkit-transition: -webkit-transform 0.5s, opacity 0.5s;
|
||||
transition: transform 0.5s, opacity 0.5s;
|
||||
}
|
||||
|
||||
.overlay-hugeinc.open nav ul {
|
||||
opacity: 1;
|
||||
-webkit-transform: rotateX(0deg);
|
||||
transform: rotateX(0deg);
|
||||
}
|
||||
|
||||
.overlay-hugeinc.close nav ul {
|
||||
-webkit-transform: translateY(25%) rotateX(-35deg);
|
||||
transform: translateY(25%) rotateX(-35deg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 9.0 - Contact Page Social
|
||||
*/
|
||||
|
||||
.social {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.social li {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.social li a {
|
||||
border: 1px solid #888;
|
||||
font-size: 22px;
|
||||
color: #888;
|
||||
transition: all 0.3s ease-in;
|
||||
}
|
||||
|
||||
.social li a:hover {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.facebook a {
|
||||
padding: 12px 21px;
|
||||
}
|
||||
|
||||
.twitter a {
|
||||
padding: 12px 15px;
|
||||
}
|
||||
|
||||
.google-plus a {
|
||||
padding: 12px 15px;
|
||||
}
|
||||
|
||||
.tumblr a {
|
||||
padding: 12px 20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* 10.0 - Contact Form
|
||||
*/
|
||||
|
||||
.contact-form input {
|
||||
border: 1px solid #aaa;
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
padding: 15px 15px;
|
||||
font-size: 16px;
|
||||
line-height: 100%;
|
||||
transition: 0.4s border-color linear;
|
||||
}
|
||||
|
||||
.contact-form textarea {
|
||||
border: 1px solid #aaa;
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
padding: 15px 15px;
|
||||
font-size: 16px;
|
||||
line-height: 20px !important;
|
||||
min-height: 183px;
|
||||
transition: 0.4s border-color linear;
|
||||
}
|
||||
|
||||
.contact-form input:focus,
|
||||
.contact-form textarea:focus {
|
||||
border-color: #666;
|
||||
}
|
||||
|
||||
.btn-send {
|
||||
background: none;
|
||||
border: 1px solid #aaa;
|
||||
cursor: pointer;
|
||||
padding: 25px 80px;
|
||||
display: inline-block;
|
||||
letter-spacing: 1px;
|
||||
position: relative;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.btn-5 {
|
||||
color: #666;
|
||||
height: 70px;
|
||||
min-width: 260px;
|
||||
line-height: 15px;
|
||||
font-size: 16px;
|
||||
overflow: hidden;
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.btn-5 span {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-transition: all 0.3s;
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-transition: all 0.3s;
|
||||
-moz-backface-visibility: hidden;
|
||||
transition: all 0.3s;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.btn-5:before {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
line-height: 2.5;
|
||||
font-size: 180%;
|
||||
-webkit-transition: all 0.3s;
|
||||
-moz-transition: all 0.3s;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.btn-5:active:before {
|
||||
color: #703b87;
|
||||
}
|
||||
|
||||
.btn-5b:hover span {
|
||||
-webkit-transform: translateX(200%);
|
||||
-moz-transform: translateX(200%);
|
||||
-ms-transform: translateX(200%);
|
||||
transform: translateX(200%);
|
||||
}
|
||||
|
||||
.btn-5b:before {
|
||||
left: -100%;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.btn-5b:hover:before {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 11.0 - Media Query
|
||||
*/
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.main-nav a {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#header-search-box {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
#header-search-box {
|
||||
right: 20px;
|
||||
top: 9px;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.btn-5 span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.btn-5b:before {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 431px) {
|
||||
.logo h1 {
|
||||
margin-top: 8px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.post {
|
||||
background: #fff;
|
||||
padding: 0 10px 0;
|
||||
}
|
||||
|
||||
.more-link {
|
||||
font-size: 0.9em;
|
||||
line-height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-height: 30.5em) {
|
||||
.overlay nav {
|
||||
height: 70%;
|
||||
font-size: 34px;
|
||||
}
|
||||
.overlay ul li {
|
||||
min-height: 34px;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@
|
||||
.pace .pace-progress {
|
||||
background: #000;
|
||||
position: fixed;
|
||||
z-index: 2000;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 1px;
|
||||
transition: width 1s;
|
||||
}
|
||||
|
||||
.pace-inactive {
|
||||
display: none;
|
||||
}
|
||||
|
After Width: | Height: | Size: 62 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,152 @@
|
||||
var searchvisible = 0;
|
||||
|
||||
$("#search-menu").click(function(e){
|
||||
//This stops the page scrolling to the top on a # link.
|
||||
e.preventDefault();
|
||||
|
||||
var val = $('#search-icon');
|
||||
if(val.hasClass('ion-ios-search-strong')){
|
||||
val.addClass('ion-ios-close-empty');
|
||||
val.removeClass('ion-ios-search-strong');
|
||||
}
|
||||
else{
|
||||
val.removeClass('ion-ios-close-empty');
|
||||
val.addClass('ion-ios-search-strong');
|
||||
}
|
||||
|
||||
|
||||
if (searchvisible ===0) {
|
||||
//Search is currently hidden. Slide down and show it.
|
||||
$("#search-form").slideDown(200);
|
||||
$("#s").focus(); //Set focus on the search input field.
|
||||
searchvisible = 1; //Set search visible flag to visible.
|
||||
}
|
||||
|
||||
else {
|
||||
//Search is currently showing. Slide it back up and hide it.
|
||||
$("#search-form").slideUp(200);
|
||||
searchvisible = 0;
|
||||
}
|
||||
});
|
||||
|
||||
/*!
|
||||
* classie - class helper functions
|
||||
* from bonzo https://github.com/ded/bonzo
|
||||
*
|
||||
* classie.has( elem, 'my-class' ) -> true/false
|
||||
* classie.add( elem, 'my-new-class' )
|
||||
* classie.remove( elem, 'my-unwanted-class' )
|
||||
* classie.toggle( elem, 'my-class' )
|
||||
*/
|
||||
|
||||
/*jshint browser: true, strict: true, undef: true */
|
||||
/*global define: false */
|
||||
|
||||
( function( window ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// class helper functions from bonzo https://github.com/ded/bonzo
|
||||
|
||||
function classReg( className ) {
|
||||
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
|
||||
}
|
||||
|
||||
// classList support for class management
|
||||
// altho to be fair, the api sucks because it won't accept multiple classes at once
|
||||
var hasClass, addClass, removeClass;
|
||||
|
||||
if ( 'classList' in document.documentElement ) {
|
||||
hasClass = function( elem, c ) {
|
||||
return elem.classList.contains( c );
|
||||
};
|
||||
addClass = function( elem, c ) {
|
||||
elem.classList.add( c );
|
||||
};
|
||||
removeClass = function( elem, c ) {
|
||||
elem.classList.remove( c );
|
||||
};
|
||||
}
|
||||
else {
|
||||
hasClass = function( elem, c ) {
|
||||
return classReg( c ).test( elem.className );
|
||||
};
|
||||
addClass = function( elem, c ) {
|
||||
if ( !hasClass( elem, c ) ) {
|
||||
elem.className = elem.className + ' ' + c;
|
||||
}
|
||||
};
|
||||
removeClass = function( elem, c ) {
|
||||
elem.className = elem.className.replace( classReg( c ), ' ' );
|
||||
};
|
||||
}
|
||||
|
||||
function toggleClass( elem, c ) {
|
||||
var fn = hasClass( elem, c ) ? removeClass : addClass;
|
||||
fn( elem, c );
|
||||
}
|
||||
|
||||
var classie = {
|
||||
// full names
|
||||
hasClass: hasClass,
|
||||
addClass: addClass,
|
||||
removeClass: removeClass,
|
||||
toggleClass: toggleClass,
|
||||
// short names
|
||||
has: hasClass,
|
||||
add: addClass,
|
||||
remove: removeClass,
|
||||
toggle: toggleClass
|
||||
};
|
||||
|
||||
// transport
|
||||
if ( typeof define === 'function' && define.amd ) {
|
||||
// AMD
|
||||
define( classie );
|
||||
} else {
|
||||
// browser global
|
||||
window.classie = classie;
|
||||
}
|
||||
|
||||
})( window );
|
||||
|
||||
(function() {
|
||||
var triggerBttn = document.getElementById( 'trigger-overlay' ),
|
||||
overlay = document.querySelector( 'div.overlay' ),
|
||||
closeBttn = overlay.querySelector( 'button.overlay-close' );
|
||||
transEndEventNames = {
|
||||
'WebkitTransition': 'webkitTransitionEnd',
|
||||
'MozTransition': 'transitionend',
|
||||
'OTransition': 'oTransitionEnd',
|
||||
'msTransition': 'MSTransitionEnd',
|
||||
'transition': 'transitionend'
|
||||
},
|
||||
transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],
|
||||
support = { transitions : Modernizr.csstransitions };
|
||||
|
||||
function toggleOverlay() {
|
||||
if( classie.has( overlay, 'open' ) ) {
|
||||
classie.remove( overlay, 'open' );
|
||||
classie.add( overlay, 'close' );
|
||||
var onEndTransitionFn = function( ev ) {
|
||||
if( support.transitions ) {
|
||||
if( ev.propertyName !== 'visibility' ) return;
|
||||
this.removeEventListener( transEndEventName, onEndTransitionFn );
|
||||
}
|
||||
classie.remove( overlay, 'close' );
|
||||
};
|
||||
if( support.transitions ) {
|
||||
overlay.addEventListener( transEndEventName, onEndTransitionFn );
|
||||
}
|
||||
else {
|
||||
onEndTransitionFn();
|
||||
}
|
||||
}
|
||||
else if( !classie.has( overlay, 'close' ) ) {
|
||||
classie.add( overlay, 'open' );
|
||||
}
|
||||
}
|
||||
|
||||
triggerBttn.addEventListener( 'click', toggleOverlay );
|
||||
closeBttn.addEventListener( 'click', toggleOverlay );
|
||||
})();
|
||||
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
|
||||
"""
|
||||
@version: ??
|
||||
@author: liangliangyy
|
||||
@license: MIT Licence
|
||||
@contact: liangliangyy@gmail.com
|
||||
@site: https://www.lylinux.org/
|
||||
@software: PyCharm
|
||||
@file: urls.py
|
||||
@time: 2016/11/2 下午7:15
|
||||
"""
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.IndexView.as_view(), name='index'),
|
||||
]
|
||||
@ -0,0 +1,6 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import Comment
|
||||
|
||||
admin.site.register(Comment)
|
||||
@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CommentsConfig(AppConfig):
|
||||
name = 'comments'
|
||||
@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.2 on 2016-11-02 12:49
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Comment',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('body', models.TextField(verbose_name='正文')),
|
||||
('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
|
||||
('last_mod_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
|
||||
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='作者')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': '评论',
|
||||
'ordering': ['created_time'],
|
||||
'verbose_name': '评论',
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,21 @@
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class Comment(models.Model):
|
||||
body = models.TextField('正文')
|
||||
created_time = models.DateTimeField('创建时间', auto_now_add=True)
|
||||
last_mod_time = models.DateTimeField('修改时间', auto_now=True)
|
||||
author = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name='作者', on_delete=models.CASCADE)
|
||||
|
||||
|
||||
class Meta:
|
||||
ordering = ['created_time']
|
||||
verbose_name = "评论"
|
||||
verbose_name_plural = verbose_name
|
||||
|
||||
def __str__(self):
|
||||
return self.body
|
||||
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Loading…
Reference in new issue