Sencha website - first draft. :)
commit
e27d35ee8a
|
@ -0,0 +1,6 @@
|
|||
drop table if exists entries;
|
||||
create table entries (
|
||||
id integer primary key autoincrement,
|
||||
title string not null,
|
||||
text string not null
|
||||
);
|
|
@ -0,0 +1,76 @@
|
|||
# all the imports
|
||||
from __future__ import with_statement
|
||||
from contextlib import closing
|
||||
import sqlite3
|
||||
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, jsonify
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import re
|
||||
from email.mime.text import MIMEText
|
||||
from subprocess import Popen, PIPE
|
||||
import smtplib
|
||||
|
||||
# configuration
|
||||
DATABASE = '/tmp/dysprosium.db'
|
||||
DEBUG = True
|
||||
SECRET_KEY = 'development key'
|
||||
USERNAME = 'admin'
|
||||
PASSWORD = 'dupa.8'
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(__name__)
|
||||
|
||||
|
||||
def connect_db():
|
||||
return sqlite3.connect(app.config['DATABASE'])
|
||||
|
||||
def init_db():
|
||||
with closing(connect_db()) as db:
|
||||
with app.open_resource('schema.sql') as f:
|
||||
db.cursor().executescript(f.read())
|
||||
db.commit()
|
||||
|
||||
@app.before_request
|
||||
def before_request():
|
||||
g.db = connect_db()
|
||||
|
||||
@app.teardown_request
|
||||
def teardown_request(exception):
|
||||
g.db.close()
|
||||
|
||||
@app.route('/')
|
||||
def home():
|
||||
return render_template('sencha.html')
|
||||
|
||||
@app.route('/examples')
|
||||
def examples():
|
||||
return render_template('examples.html')
|
||||
|
||||
@app.route('/docs')
|
||||
def docs():
|
||||
return render_template('documentation.html')
|
||||
|
||||
@app.route('/source')
|
||||
def source():
|
||||
return render_template('source.html')
|
||||
|
||||
@app.route('/contact')
|
||||
def contact():
|
||||
return render_template('contact.html')
|
||||
|
||||
@app.route('/howtos')
|
||||
def howtos():
|
||||
return render_template('howtos.html')
|
||||
|
||||
|
||||
|
||||
|
||||
#this api is broken and inconsistent, I don't like it, mayby it'd be better to start with something different soon?
|
||||
#a95ae api key for word reference is: a95ae
|
||||
#http://www.wordreference.com/docs/api.aspx
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
init_db()
|
||||
app.run()
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<script type="text/javascript">
|
||||
//Change active button in navbar
|
||||
$("document").ready( function(){
|
||||
$("li").removeClass("active");
|
||||
$("#contact").addClass("active");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="hero-unit">
|
||||
<p>Contact!</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,18 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<script type="text/javascript">
|
||||
//Change active button in navbar
|
||||
$("document").ready( function(){
|
||||
$("li").removeClass("active");
|
||||
$("#docs").addClass("active");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="hero-unit">
|
||||
<p>Documentation!</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<script type="text/javascript">
|
||||
//Change active button in navbar
|
||||
$("document").ready( function(){
|
||||
$("li").removeClass("active");
|
||||
$("#examples").addClass("active");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="hero-unit">
|
||||
<p>Examples!</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,17 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<script type="text/javascript">
|
||||
//Change active button in navbar
|
||||
$("document").ready( function(){
|
||||
$("li").removeClass("active");
|
||||
$("#howtos").addClass("active");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="hero-unit">
|
||||
<p>Howto's!</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,68 @@
|
|||
<!doctype html>
|
||||
<title>Sencha</title>
|
||||
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='bootstrap.css') }}">
|
||||
|
||||
<script type=text/javascript>
|
||||
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="hero-unit">
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
SenchaLogo
|
||||
<img src="http://tanabatagreentea.com/ESW/Images/7_Star_Sencha.jpg?xcache=9390" alt="some photo" height="300"
|
||||
width="300">
|
||||
</div>
|
||||
<div class="span8">
|
||||
<h1>Sencha</h1>
|
||||
<p>What can I say about sencha? It's a lot of fun writing it. Lots of pain and satisfaction. Work is still in progress. I don't even know, how it would finally be like. But I am very open for suggestions, however I want to keep it as simple as possible as comfy to dive into as possible. It is interpreted, can be interactive. Written in C++. </p>
|
||||
<button class="btn btn-large btn-info" id="help-me">Start</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<ul class="nav">
|
||||
<li class="active" id="home"><a href="/" >About</a></li>
|
||||
<li id="docs"><a href="{{ url_for('docs') }}" >Docs</a></li>
|
||||
<li id="source"><a href="{{ url_for('source') }}">Source</a></li>
|
||||
<li id="examples"><a href="{{ url_for('examples') }}" >Examples</a></li>
|
||||
<li id="howtos"><a href="{{ url_for('howtos') }}" >Howto's</a></li>
|
||||
<li id="contact"><a href="{{ url_for('contact') }}" >Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span8">
|
||||
{% for message in get_flashed_messages() %}
|
||||
<div class=flash>{{ message }}</div>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<script type="text/javascript">
|
||||
//Change active button in navbar
|
||||
$("document").ready( function(){
|
||||
$("li").removeClass("active");
|
||||
$("#home").addClass("active");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
<div class="hero-unit">
|
||||
<p>Sencha!</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
|
||||
<script type="text/javascript">
|
||||
//Change active button in navbar
|
||||
$("document").ready( function(){
|
||||
$("li").removeClass("active");
|
||||
$("#source").addClass("active");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="hero-unit">
|
||||
<p>Source!</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue