Skip to content
Snippets Groups Projects
Commit 38b281c5 authored by Xingchen Zhou's avatar Xingchen Zhou
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 643 additions and 0 deletions
blog/static/upload/small_01.jpg

963 B

blog/static/upload/small_02.jpg

963 B

blog/static/upload/small_03.jpg

963 B

blog/static/upload/small_04.jpg

963 B

blog/static/upload/small_05.jpg

963 B

blog/static/upload/small_06.jpg

963 B

blog/static/upload/small_07.jpg

963 B

blog/static/upload/small_08.jpg

963 B

blog/static/upload/small_09.jpg

963 B

blog/static/upload/theme1.jpg

74 KiB

blog/static/upload/theme2.jpg

65.7 KiB

File added
{% extends "layout.html" %}
{% block content %}
<section class="section lb m3rem">
<div class="container">
<div class="custombox clearfix">
<h4 class="small-title">About us</h4>
<div class="row">
Software Development Times, better known as SD Times, is a magazine published by D2 Emerge, in both a print version and an on-line electronic edition.
<br./>
It has been published since 2000. The first issue appeared in February 2000. The headquarters is in Melville, New York. Since 2003, it has published an annual award list, the "SD Times 100", which honors the top 100 leaders and innovators in the software development industry, as judged by SD Times' editors.
<br/>
Starting in January 2011, SD Times switched from a bi-monthly to monthly circulation. In July 2017, BZ Media sold SD Times to D2 Emerge, co-founded by then publisher David Lyman and long-time editor-in-chief David Rubenstein.
<br/>
Christina Cardoza was named SD Times' news editor in December 2017 by D2Emerge.
<br/>
<br/>
Reference: https://en.wikipedia.org/wiki/SD_Times
</div>
</div>
</div>
</section>
{% endblock content %}
{% extends'admin/master.html' %}
{% block body %}
{% if current_user.is_admin %}
Welcome to the admin panel {{ current_user.username }}!
{% else %}
Hello, please login as an admin before accessing this panel &nbsp|<a href="{{ url_for('login') }}">Login&nbsp;</a>
{% endif %}
{% endblock %}
{% extends "layout.html" %}
{% block content %}
<!-- {% for post in posts %}
<p><a href="{{ url_for('post', post_id=post.id) }}"><img src="{{ url_for('static', filename='img/' + post.image_file) }}">
"{{ post.title }}"</a>&nbsp
by {{ post.user.username }}</p>
<p>
{% autoescape false %}
{{ post.shortcontent }}...
{% endautoescape %}
</p>
{% endfor %} -->
<div class="page-title db">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<h2> Blog <small class="hidden-xs-down hidden-sm-down">Here you can find all interesting posts</small></h2>
</div><!-- end col -->
<div class="col-lg-4 col-md-4 col-sm-12 hidden-xs-down hidden-sm-down">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ url_for('home') }}">Home</a></li>
<li class="breadcrumb-item active"><a href="{{ url_for('allposts') }}" >All Posts</a></li>
</ol>
</div><!-- end col -->
</div><!-- end row -->
</div><!-- end container -->
</div><!-- end page-title -->
<section class="section lb">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<h3>
All posts sort by date
<button><a href="{{ url_for('allposts',sorttype='asc', searchtext='') }}">ascending</a></button>
/
<button><a href="{{ url_for('allposts',sorttype='dsc', searchtext='') }}">descending</a></button>
</h3>
<div class="page-wrapper">
<div class="blog-custom-build">
{% for post in posts %}
<div class="blog-box wow fadeIn">
<div class="post-media">
<a href="{{ url_for('post', post_id=post.id) }}">
<img src="{{ url_for('static', filename='images/' + post.image_file) }}" class="img-fluid">
<div class="hovereffect">
<span></span>
</div>
</a>
</div>
<!-- end media -->
<div class="blog-meta big-meta text-center">
<div class="post-sharing">
<ul class="list-inline">
<li><a href="#" class="fb-button btn btn-primary"><i class="fa fa-facebook"></i> <span class="down-mobile">Share on Facebook</span></a></li>
<li><a href="#" class="tw-button btn btn-primary"><i class="fa fa-twitter"></i> <span class="down-mobile">Tweet on Twitter</span></a></li>
<li><a href="#" class="gp-button btn btn-primary"><i class="fa fa-google-plus"></i></a></li>
</ul>
</div><!-- end post-sharing -->
<h4><a href="{{ url_for('post', post_id=post.id) }}" title="">{{ post.title }}</a></h4>
<!-- <p>
{% autoescape false %}
{{ post.shortcontent }}....
{% endautoescape %}
</p> -->
<!-- <small><a href="marketing-category.html" title="">Make Money</a></small> -->
<small><a href="{{ url_for('post', post_id=post.id) }}" title="">{{post.date}}</a></small>
<small><a href="#" title="">by {{post.user.username}}</a></small>
<!-- <small><a href="#" title=""><i class="fa fa-eye"></i> 2291</a></small> -->
</div><!-- end meta -->
</div><!-- end blog-box -->
<hr class="invis">
{% endfor %}
</div>
<!-- <div class="row">
<div class="col-md-12">
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
</div>
</div> -->
</div><!-- end col -->
</div><!-- end row -->
</div><!-- end container -->
</section>
<!-- <div class="container">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Sort By <i class="fa fa-fw fa-sort"></i>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="{{ url_for('allposts',sorttype='asc', searchtext='') }}">ascending</a></li>
<li><a href="{{ url_for('allposts',sorttype='dsc', searchtext='') }}">descending</a></li>
</ul>
<ul class="list-group">
{% for post in posts %}
<li class="list-group-item clearfix">
<a href="{{ url_for('post', post_id=post.id) }}">
<img class="img-responsive img-rounded" src="{{ url_for('static', filename='img/' + post.image_file) }}">
<h3 class="list-group-item-heading">
{{ post.title }}
</h3>
</a>&nbsp
<i>by {{ post.user.username }} at {{post.date}}</i>
<p class="list-group-item-text lead">
{% autoescape false %}
{{ post.shortcontent }}
{% endautoescape %}
<a href="{{ url_for('post', post_id=post.id) }}"><small>Details&#8230;</small></a>
</p>
</li>
{% endfor %}
</ul>
</div> -->
{% endblock content %}
{% extends "layout.html" %}
{% block content %}
<!-- {% for post in posts %}
<p><a href="{{ url_for('post', post_id=post.id) }}"><img src="{{ url_for('static', filename='img/' + post.image_file) }}">
"{{ post.title }}"</a>&nbsp
by {{ post.user.username }}</p>
<p>{{ post.content }}</p>
{% endfor %} -->
<section id="cta" class="section">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-12 align-self-center">
<h2>A Software Development Blog</h2>
<p class="lead"> First solve the problem, then write the code. by John Johnson</p>
<a href="{{ url_for('allposts') }}" class="btn btn-primary">Read all posts</a>
</div>
</div>
</div>
</section>
<section class="section lb">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="page-wrapper">
<div class="blog-custom-build">
{% for postIndex in range(0,3) %}
<div class="blog-box wow fadeIn">
<div class="post-media">
<a href="{{ url_for('post', post_id=posts[postIndex].id) }}">
<img src="{{ url_for('static', filename='images/' + posts[postIndex].image_file) }}" class="img-fluid">
<div class="hovereffect">
<span></span>
</div>
</a>
</div>
<!-- end media -->
<div class="blog-meta big-meta text-center">
<h4><a href="{{ url_for('post', post_id=posts[postIndex].id) }}" title="">{{ posts[postIndex].title }}</a></h4>
<small><a href="{{ url_for('post', post_id=posts[postIndex].id) }}" title="">{{posts[postIndex].date}}</a></small>
<small><a href="#" title="">by {{posts[postIndex].user.username}}</a></small>
</div><!-- end meta -->
</div><!-- end blog-box -->
<hr class="invis">
{% endfor %}
</div>
<a href="{{ url_for('allposts') }}" class="btn btn-primary" style="width: 100%">Read all posts</a>
<!-- <div class="row">
<div class="col-md-12">
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#">Next</a>
</li>
</ul>
</nav>
</div>
</div> -->
</div><!-- end col -->
</div><!-- end row -->
</div><!-- end container -->
</section>
{% endblock content %}
<!DOCTYPE html>
<html lang="en">
<!-- Basic -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Mobile Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Site Metas -->
<title>Our awesome blog</title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="author" content="">
<!-- Site Icons -->
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<!-- Design fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,700" rel="stylesheet">
<!-- Bootstrap core CSS -->
<link href="{{ url_for('static', filename='css/bootstrap.css') }}" rel="stylesheet">
<!-- FontAwesome Icons core CSS -->
<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
<!-- Animate styles for this template -->
<link href="{{ url_for('static', filename='css/animate.css') }}" rel="stylesheet">
<!-- Responsive styles for this template -->
<link href="{{ url_for('static', filename='css/responsive.css') }}" rel="stylesheet">
<!-- Colors for this template -->
<link href="{{ url_for('static', filename='css/colors.css') }}" rel="stylesheet">
<!-- Version Marketing CSS for this template -->
<link href="{{ url_for('static', filename='css/version/marketing.css') }}" rel="stylesheet">
</head>
<body>
<div id="wrapper">
<header class="market-header header">
<div class="container-fluid">
<nav class="navbar navbar-toggleable-md navbar-inverse fixed-top bg-inverse">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="marketing-index.html"><img src="images/version/market-logo.png" alt=""></a>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a href="{{ url_for('home') }}" class="nav-item nav-link">Home</a>
</li>
<li class="nav-item">
<a href="{{ url_for('allposts') }}" class="nav-item nav-link">View All Posts</a>
</li>
{% if current_user.is_authenticated %}
<li class="nav-item">
<a href="" class="nav-item nav-link">Hello, {{ current_user.username }}!</a>
</li>
<li class="nav-item">
<a href="{{ url_for('logout') }}" class="nav-item nav-link">Logout</a>
</li>
{% else %}
<li class="nav-item">
<a href="" class="nav-item nav-link">Hello, Guest!</a>
</li>
<li class="nav-item">
<a href="{{ url_for('login') }}" class="nav-item nav-link">Login</a>
</li>
<li class="nav-item">
<a href="{{ url_for('register') }}" class="nav-item nav-link">Register</a>
</li>
{% endif %}
<li class="nav-item">
<a href="{{ url_for('aboutus') }}" class="nav-item nav-link">About Us</a>
</li>
<li class="nav-item">
{% with messages = get_flashed_messages() %}
{% if messages %}
<ulclass=flashes>
{% for message in messages %}
<li class="nav-item nav-link" style="color: red;">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</li>
</ul>
<form class="form-inline" method="post" action="{{ url_for('search') }}">
<input class="form-control mr-sm-2" type="search" name="search" value="" placeholder="How may I help?">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit" title="Search">Search</button>
</form>
</div>
</nav>
</div><!-- end container-fluid -->
</header><!-- end market-header -->
<div id="content">
{% block content %}
{% endblock %}
</div>
<div class="dmtop">Scroll to Top</div>
<script src="{{ url_for('static', filename='js/jquery.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/tether.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js')}}"></script>
<script src="{{ url_for('static', filename='js/animate.js')}}"></script>
<script src="{{ url_for('static', filename='js/custom.js')}}"></script>
<!-- <script src="{{ url_for('static', filename='js/jquery.min.js')}}"></script> -->
</body>
</html>
{% extends "layout.html" %}
{% block content %}
<section class="section lb m3rem">
<div class="container">
<div class="custombox clearfix">
<h4 class="small-title">Login</h4>
<div class="row">
<div class="col-lg-12">
<form class="form-wrapper" method="POST" action="">
{{ form.csrf_token }}
{{ form.email.label }}
{{ form.email(class_="form-control") }}
{{ form.password.label }}
{{ form.password(class_="form-control") }}
<button type="submit" class="btn btn-primary">Login</button>
</form>
</div>
</div>
</div>
</div>
</section>
{% endblock content %}
{% extends "layout.html" %}
{% block content %}
<style type="text/css">
.rating {
border: none;
margin-right: calc(100% - 225px);
}
.myratings {
color: green
}
.rating>[id^="star"] {
display: none
}
.rating>label:before {
margin: 5px;
font-size: 2.25em;
font-family: FontAwesome;
display: inline-block;
content: "\f005"
}
.rating>.half:before {
content: "\f089";
position: absolute
}
.rating>label {
color: #ddd;
float: right
}
.rating>[id^="star"]:checked~label,
.rating:not(:checked)>label:hover,
.rating:not(:checked)>label:hover~label {
color: #FFD700
}
.rating>[id^="star"]:checked+label:hover,
.rating>[id^="star"]:checked~label:hover,
.rating>label:hover~[id^="star"]:checked~label,
.rating>[id^="star"]:checked~label:hover~label {
color: #FFED85
}
</style>
<section class="section lb m3rem">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="page-wrapper">
<div class="blog-title-area">
<ol class="breadcrumb hidden-xs-down">
<li class="breadcrumb-item"><a href="{{ url_for('home') }}">Home</a></li>
<li class="breadcrumb-item"><a href="{{ url_for('allposts') }}" >All Blog</a></li>
<li class="breadcrumb-item active">{{ post.title }}</li>
</ol>
<!-- <span class="color-yellow"><a href="marketing-category.html" title="">Lifestyle</a></span> -->
<h3>{{ post.title }}</h3>
<div class="blog-meta big-meta">
<small><a href="marketing-single.html" title="">{{ post.date }}</a></small>
<small><a href="blog-author.html" title="">by {{ post.user.username }}</a></small>
<!-- <small><a href="#" title=""><i class="fa fa-eye"></i> 2344</a></small> -->
</div><!-- end meta -->
<!-- <div class="post-sharing">
<ul class="list-inline">
<li><a href="#" class="fb-button btn btn-primary"><i class="fa fa-facebook"></i> <span class="down-mobile">Share on Facebook</span></a></li>
<li><a href="#" class="tw-button btn btn-primary"><i class="fa fa-twitter"></i> <span class="down-mobile">Tweet on Twitter</span></a></li>
<li><a href="#" class="gp-button btn btn-primary"><i class="fa fa-google-plus"></i></a></li>
</ul>
</div> -->
</div><!-- end title -->
<div class="single-post-media">
<img src="upload/market_blog_06.jpg" alt="" class="img-fluid">
</div><!-- end media -->
<div class="blog-content">
{% autoescape false %}
{{ post.content }}
{% endautoescape %}
<div id="post_id" style="display: none">
{{post.id}}
</div>
</div><!-- end content -->
<hr class="invis1">
<div class="custombox clearfix">
<h4 class="small-title">Do you like this post?</h4>
<fieldset class="rating">
<script type="text/javascript">
function updateStars(rate) {
console.log(rate);
console.log($("#post_id").text().trim());
$.ajax({
url : '/ratepost/'+$("#post_id").text().trim()+'?rate='+rate,
type : 'GET',
success : function(rs){
console.log(rs)
},
error : function(error) {
console.log(error)
// $(".myratings").html("Please login to rate")
window.location.href = "/login";
}
});
}
</script>
{% for rIndex in range(5,0,-1) %}
{% if rate <= rIndex : %}
<input type="radio" id="star{{rIndex}}" name="rating" value="{{rIndex}}" onchange="updateStars('{{rIndex}}')" checked />
<label class="full" for="star{{rIndex}}" title="{{rIndex}} stars"></label>
{% else %}
<input type="radio" id="star{{rIndex}}" name="rating" value="{{rIndex}}" onchange="updateStars('{{rIndex}}')" />
<label class="full" for="star{{rIndex}}" title="{{rIndex}} stars"></label>
{% endif %}
{% endfor %}
</fieldset>
</div><!-- end custom-box -->
<hr class="invis1">
<hr class="invis1">
<div class="custombox clearfix">
<h4 class="small-title">Comments</h4>
<div class="row">
<div class="col-lg-12">
<div class="comments-list">
{% for comment in comments %}
<div class="media">
<div class="media-body">
<h4 class="media-heading user_name">{{comment.user.username}} <small>{{comment.date}}</small></h4>
<p>{{comment.content}}</p>
<a href="#leaveReply" class="btn btn-primary btn-sm">Reply</a>
</div>
</div>
{% endfor %}
</div>
</div><!-- end col -->
</div><!-- end row -->
</div><!-- end custom-box -->
<hr class="invis1">
<div class="custombox clearfix">
<h4 class="small-title" id="leaveReply">Leave a Reply</h4>
<div class="row">
<div class="col-lg-12">
<form method="post" class="form-wrapper" action="{{ url_for('post_comment', post_id=post.id) }}">
{{ form.hidden_tag() }}
<!-- <textarea name="comment" id="comment" cols="25" rows="10"></textarea> -->
{{ form.comment(class_="form-control") }}
{{ form.submit(class_="btn btn-primary") }}
{% for error in form.comment.errors %}<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</div>
</form>
</div>
</div>
</div>
</div><!-- end page-wrapper -->
</div><!-- end col -->
</div><!-- end row -->
</div><!-- end container -->
</section>
<div class="dmtop">Scroll to Top</div>
</div><!-- end wrapper -->
{% endblock content %}
{% extends "layout.html" %}
{% block content %}
<section class="section lb m3rem">
<div class="container">
<div class="custombox clearfix">
<h4 class="small-title">Register</h4>
<div class="row">
<div class="col-lg-12">
<form class="form-wrapper" method="POST" action="">
{{ form.csrf_token }}
{{ form.username.label }}
{{ form.username(class_="form-control") }}
{% for error in form.username.errors %}<span style="color: red;">[{{ error }}]</span><br/>{% endfor %}
{{ form.email.label }}
{{ form.email(class_="form-control") }}
{% for error in form.email.errors %} <span style="color: red;">[{{ error }}]</span><br/>{% endfor %}
{{ form.password.label }}
{{ form.password(class_="form-control") }}
{% for error in form.password.errors %}<span style="color: red;">[{{ error }}]</span><br/>{% endfor %}
{{ form.confirm_password.label }}
{{ form.confirm_password(class_="form-control") }}
{% for error in form.confirm_password.errors %}<span style="color: red;">[{{ error }}]</span><br/>{% endfor %}
<button type="submit" class="btn btn-primary">Register</button>
</form>
</div>
</div>
</div>
</div>
</section>
{% endblock content %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment