Skip to content

Commit

Permalink
add web project.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyqin committed Mar 25, 2018
1 parent 05b174b commit 7ce3db7
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 1 deletion.
4 changes: 3 additions & 1 deletion requirements.txt
@@ -1 +1,3 @@
pytest
pytest
flask
flask-bootstrap
3 changes: 3 additions & 0 deletions web.py
@@ -0,0 +1,3 @@
from web.app import app

app.run()
3 changes: 3 additions & 0 deletions web/__init__.py
@@ -0,0 +1,3 @@
class Config(object):
BOOTSTRAP_USE_MINIFIED = True
BOOTSTRAP_SERVE_LOCAL = True
13 changes: 13 additions & 0 deletions web/app.py
@@ -0,0 +1,13 @@
from flask import render_template, Flask
from flask_bootstrap import Bootstrap

from web import Config

app = Flask(__name__)
app.config.from_object(Config)
Bootstrap(app)


@app.route('/')
def index():
return render_template('hash.html')
43 changes: 43 additions & 0 deletions web/static/style.css
@@ -0,0 +1,43 @@
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}

/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by its height */
margin: 0 auto -60px;
/* Pad bottom by footer height */
padding: 0 0 60px;
}

/* Set the fixed height of the footer here */
#footer {
height: 60px;
background-color: #f5f5f5;
}

/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

#wrap > .container {
padding: 40px 15px 0;
}

.container .credit {
margin: 20px 0;
}

#footer > .container {
padding-left: 15px;
padding-right: 15px;
}

code {
font-size: 80%;
}
13 changes: 13 additions & 0 deletions web/templates/hash.html
@@ -0,0 +1,13 @@
{% extends "./layout.html" %}

{% block title %}Photo Dup by Hash{% endblock %}

{% block page_header %}
<h2>111212131 (3)</h2>
{% endblock %}

{% block content_area %}
<form>
<input type="checkbox" name="sports" value="soccer"/> file 1
</form>
{% endblock %}
46 changes: 46 additions & 0 deletions web/templates/layout.html
@@ -0,0 +1,46 @@
{% extends "bootstrap/base.html" %}
{% block title %}Home{% endblock %}

{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
{% endblock %}


{% block content %}
<div id="wrap">
<!-- Begin nav bar -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">PHOTODUP</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/">By Hash</a></li>
<li><a href="/">By Name</a></li>
</ul>
</div>
</div>
</div>

<!-- Begin page content -->
<div class="container">
<div class="page-header">
{% block page_header %}{% endblock %}
</div>
{% block content_area %}{% endblock %}
</div>
</div>
<div id="footer">
<div class="container">
<p class="text-muted credit">Copyright © <a href="https://github.com/tobyqin/">Toby Qin</a>
- <a href="https://github.com/tobyqin/photodup">Source at Github</a></p>
</div>
</div>
{% endblock %}

0 comments on commit 7ce3db7

Please sign in to comment.