Initial commit.

master
q3k 2012-10-18 16:01:08 +02:00
commit 913179fd3c
49 changed files with 13007 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
webapp/config.py
*.sqlite
*.pyc

47
manage.py Normal file
View File

@ -0,0 +1,47 @@
import sys
import sqlite3
try:
from webapp import config
except ImportError:
raise Exception("Could not import config file. Does config.py exist?")
def usage():
sys.stderr.write("""Usage: %s <action> <parameters>
Where action is one of:
createdb - create database and tables (THIS WILL DESTROY YOUR STUFF)
createadmin - create admin user\n""")
def main():
if len(sys.argv) < 2:
usage()
return 1
action = sys.argv[1]
if action not in ["createdb", "createadmin"]:
usage()
return 1
if action == "createdb":
conn = sqlite3.connect(config.DB_FILE)
c = conn.cursor()
c.execute("DROP TABLE IF EXISTS quotes;")
c.execute("""CREATE TABLE quotes (
_id integer primary key autoincrement not null,
_date datetime not null,
_text text not null,
_meta text,
_up integer not null default 0,
_down integer not null default 0,
_approved boolean default 0
);""")
c.execute("DROP TABLE IF EXISTS users;")
c.execute("""CREATE TABLE users (
_id integer primary key autoincrement not null,
_username text not null,
_password text not null,
_salt text not null,
_real_name text
);""")
conn.commit()
conn.close()
sys.stdout.write("Database create succesfully.\n")
sys.exit(main())

2
runserver.py Normal file
View File

@ -0,0 +1,2 @@
from webapp import app
app.run("127.0.0.1", 2007, debug=True)

14
webapp/__init__.py Normal file
View File

@ -0,0 +1,14 @@
import flask
try:
import webapp.config
except ImportError:
raise Exception("Could not import config file. Does config.py exist?")
app = flask.Flask(__name__)
app.debug = True
app.secret_key = webapp.config.SECRET
import webapp.views
from webapp import database

11
webapp/config.py.dist Normal file
View File

@ -0,0 +1,11 @@
# please change this to False in production environments
DEBUG = True
# make this unique
SECRET = "i need to be unique"
SITE_NAME = "Some Random Quote Database"
# sqlite database filename
DB_FILE = "cutedb.sqlite"

20
webapp/database.py Normal file
View File

@ -0,0 +1,20 @@
import sqlite3
import flask
from webapp import app, config
@app.before_request
def make_cursor():
flask.g.conn = sqlite3.connect(config.DB_FILE)
flask.g.db = flask.g.conn.cursor()
@app.teardown_request
def teardown_cursor(e):
flask.g.db.close()
flask.g.conn.commit()
flask.g.conn.close()
def execute(query, *args):
return flask.g.db.execute(query, args)
def fetchall():
return flask.g.db.fetchall()

10
webapp/forms.py Normal file
View File

@ -0,0 +1,10 @@
from wtforms import Form, TextField, TextAreaField, validators
class NewQuote(Form):
text = TextAreaField("Please enter the quote you wish to be submitted:", [
validators.Required(),
validators.Length(min=5, max=10000)
])
meta = TextField("Please enter any context, additional information, if any:", [validators.Length(max=100)])

43
webapp/static/404.html Normal file
View File

@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found :(</title>
<style>
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
::selection { background: #fe57a1; color: #fff; text-shadow: none; }
html { padding: 30px 10px; font-size: 20px; line-height: 1.4; color: #737373; background: #f0f0f0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
html, input { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
body { max-width: 500px; _width: 500px; padding: 30px 20px 50px; border: 1px solid #b3b3b3; border-radius: 4px; margin: 0 auto; box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff; background: #fcfcfc; }
h1 { margin: 0 10px; font-size: 50px; text-align: center; }
h1 span { color: #bbb; }
h3 { margin: 1.5em 0 0.5em; }
p { margin: 1em 0; }
ul { padding: 0 0 0 40px; margin: 1em 0; }
.container { max-width: 380px; _width: 380px; margin: 0 auto; }
/* google search */
#goog-fixurl ul { list-style: none; padding: 0; margin: 0; }
#goog-fixurl form { margin: 0; }
#goog-wm-qt, #goog-wm-sb { border: 1px solid #bbb; font-size: 16px; line-height: normal; vertical-align: top; color: #444; border-radius: 2px; }
#goog-wm-qt { width: 220px; height: 20px; padding: 5px; margin: 5px 10px 0 0; box-shadow: inset 0 1px 1px #ccc; }
#goog-wm-sb { display: inline-block; height: 32px; padding: 0 10px; margin: 5px 0 0; white-space: nowrap; cursor: pointer; background-color: #f5f5f5; background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1); -webkit-appearance: none; -moz-appearance: none; appearance: none; *overflow: visible; *display: inline; *zoom: 1; }
#goog-wm-sb:hover, #goog-wm-sb:focus { border-color: #aaa; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); background-color: #f8f8f8; }
#goog-wm-qt:focus, #goog-wm-sb:focus { border-color: #105cb6; outline: 0; color: #222; }
input::-moz-focus-inner { padding: 0; border: 0; }
</style>
</head>
<body>
<div class="container">
<h1>Not found <span>:(</span></h1>
<p>Sorry, but the page you were trying to view does not exist.</p>
<p>It looks like this was the result of either:</p>
<ul>
<li>a mistyped address</li>
<li>an out-of-date link</li>
</ul>
<script>
var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host;
</script>
<script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
</div>

8
webapp/static/README Normal file
View File

@ -0,0 +1,8 @@
Test server:
w ./test znajduje się trywialna aplikacja flaskowa i konfig do uwsgi, pozwalający się pobawić.
usage:
itanic$ cd test
itanic$ uwsgi static.ini
a potem skierować przeglądarkę na itanic:9091. Port jest w static.ini.

114
webapp/static/_index.html Normal file
View File

@ -0,0 +1,114 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>hackerspace.pl css test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/style.css">
<script src="js/libs/modernizr-2.5.3.min.js"></script>
</head>
<body>
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<header>
<img id="header-glider" src="/img/hackerspace.svg" />
<a id="header-hackerspacepl" href="https://hackerspace.pl/">Warsaw Hackerspace</a>
<ul id="header-menu">
<li><a href="https://hackerspace.pl/">about</a></li>
<li><a href="https://blog.hackerspace.pl">blog</a></li>
<li><a href="https://wiki.hackerspace.pl">wiki</a></li>
<li><a href="http://code.hackerspace.pl/">code</a></li>
</ul>
</header>
<div role="main" id="main">
<div id="rotimage">
<div id="status" style="display: none;">
<img src="/img/status-open.png" alt="Sorry, we're open! - The Warsaw Hackerspace is open right now." />
<div id="status-tooltip" style="display: none;">
<p>
According to <a href="https://at.hackerspace.pl">our instruments</a> there are 5 people at the hackerspace right now.
</p>
</div>
</div>
</div>
<div id="content">
<h1>Czym jest Hackerspace?</h1>
<div class="sidebox">
<h2><a href="http://twitter.com/hackerspacepl">Twitter</a></h2>
<script type="text/javascript" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script type="text/javascript">
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 2,
interval: 6000,
width: 400,
height: 300,
theme: {
shell: {
background: '#e9e9e9',
color: '#000000'
},
tweets: {
background: '#e9e9e9',
color: '#111',
links: '#333'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().setUser('hackerspacepl').start();
</script>
<h2>Blog</h2>
<i>latest blog entries go here...</i>
</div>
<p>
Hackerspace to przestrzeń stworzona i utrzymywana przez grupę kreatywnych osób, które łączy fascynacja ogólno pojętym tworzeniem w duchu kultury hackerskiej. Przestrzeń stymuluje rozwój projektów, organizując i użyczając potrzebnych narzędzi. Hackerspace nie zna barier, jeśli masz ciekawy pomysł i szukasz ludzi chętnych do współpracy lub po prostu potrzebujesz miejsca i sprzętu - zapraszamy!
</p>
<p>
Jeżeli chcesz się do nas przyłączyć, przeczytaj dokładniejsze informacje o naszych celach i zapisz się na jedną z naszych list mailingowych. Spotykamy się we wtorki o 22 drugiej na kanale IRC #hackerspace-pl (irc.freenode.net) oraz w czwartki na żywo.
</p>
<h3>Cele</h3>
<ul>
<li>Chcemy stworzyć miejsce, w którym ludzie zainteresowani techniką, elektroniką, informatyką, mechaniką, sztuką i pokrewnymi dziedzinami tworzenia mogą się zbierać aby rozmawiać, wymieniać się pomysłami i rozwiązaniami, oraz pracować nad projektami.</li>
<li>Chcemy żeby miejsce to było w Warszawie, w miejscu zapewniającym optymalny dojazd, zwłaszcza komunikacją publiczną.</li>
<li>Chcemy niezależności, dlatego uznajemy że optymalnym źródłem finansowania są obowiązkowe składki. Składki zostaną wykorzystane na finansowanie miejsca oraz, gdy to zostanie zapewnione, na zakup narzędzi.</li>
<li>Chcemy żeby miejsce było otwarte na nowych ludzi i nowe pomysły.</li>
<li>Chcemy zebrać narzędzia i wiedzę jak się ich używa w miejscu umożliwiającym ich używanie.</li>
<li>Chcemy się rozwijać i poznawać nowe dziedziny wiedzy</li>
<li>Chcemy się dobrze bawić.</li>
</ul>
<h3>Lokalizacja</h3>
<p>
Warszawski Hackerspace znajduje się w budynku ITR, w piwnicy. Sam ITR mieści się na ulicy Długiej 44, tuż obok Metra Ratusz-Arsenał.
</p>
<center><div id="map"><img src="/img/mapka.png" style="border-radius: 4px;" /></div></center>
</div>
</div>
<footer>
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
<script src="/js/libs/jquery.timers.js"></script>
<script src="js/plugins.js"></script>
<script src="js/script.js"></script>
<script src="js/map.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
<!--
If you host a crossdomain.xml file with allow-access-from domain="*"
and dont understand all of the points described here, you probably
have a nasty security vulnerability. ~ simon willison
-->
</cross-domain-policy>

Binary file not shown.

391
webapp/static/css/style.css Normal file
View File

@ -0,0 +1,391 @@
/* HTML5 Boilerplate */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
[hidden] { display: none; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
html, button, input, select, textarea { font-family: sans-serif; color: #222; }
body { margin: 0; font-size: 1em; line-height: 1.4; }
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
::selection { background: #fe57a1; color: #fff; text-shadow: none; }
a { color: #00e; }
a:visited { color: #551a8b; }
a:hover { color: #06e; }
a:focus { outline: thin dotted; }
a:hover, a:active { outline: 0; }
abbr[title] { border-bottom: 1px dotted; }
b, strong { font-weight: bold; }
blockquote { margin: 1em 40px; }
dfn { font-style: italic; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
ins { background: #ff9; color: #000; text-decoration: none; }
mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; font-size: 1em; }
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
q { quotes: none; }
q:before, q:after { content: ""; content: none; }
small { font-size: 85%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }
ul, ol { margin: 1em 0; padding: 0 0 0 40px; }
dd { margin: 0 0 0 40px; }
nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; }
img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; }
svg:not(:root) { overflow: hidden; }
figure { margin: 0; }
form { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
label { cursor: pointer; }
legend { border: 0; *margin-left: -7px; padding: 0; white-space: normal; }
button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; }
button, input { line-height: normal; }
button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; *overflow: visible; }
button[disabled], input[disabled] { cursor: default; }
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; *width: 13px; *height: 13px; }
input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
textarea { overflow: auto; vertical-align: top; resize: vertical; }
input:valid, textarea:valid { }
input:invalid, textarea:invalid { background-color: #f0dddd; }
table { border-collapse: collapse; border-spacing: 0; }
td { vertical-align: top; }
.chromeframe { margin: 0.2em 0; background: #ccc; color: black; padding: 0.2em 0; }
@media only screen and (min-width: 35em) {
}
.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; *line-height: 0; }
.ir br { display: none; }
.hidden { display: none !important; visibility: hidden; }
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
.invisible { visibility: hidden; }
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1; }
@media print {
* { background: transparent !important; color: black !important; box-shadow:none !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; }
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; }
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}
body {
background-image: url("../img/fake_brick.png");
color: #eee;
padding-top: 10px;
}
header {
width: 1014px;
height: 64px;
margin-left: auto;
margin-right: auto;
padding: 5px;
border-radius: 3px;
outline-color: #777;
background: rgb(91,91,91);
background: -moz-linear-gradient(top, rgba(91,91,91,1) 0%, rgba(51,51,51,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(91,91,91,1)), color-stop(100%,rgba(51,51,51,1)));
background: -webkit-linear-gradient(top, rgba(91,91,91,1) 0%,rgba(51,51,51,1) 100%);
background: -o-linear-gradient(top, rgba(91,91,91,1) 0%,rgba(51,51,51,1) 100%);
background: -ms-linear-gradient(top, rgba(91,91,91,1) 0%,rgba(51,51,51,1) 100%);
background: linear-gradient(top, rgba(91,91,91,1) 0%,rgba(51,51,51,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5b5b5b', endColorstr='#333333',GradientType=0 );
}
#header-glider {
height: 50px;
margin-top: 7px;
margin-left: 7px;
float: left;
}
#header-hackerspacepl {
float: left;
color: #eee;
font-family: sans-serif;
font-size: 35px;
font-weight: 800;
text-decoration: none;
margin-left: 20px;
margin-top: 6px;
color: #fff;
}
#header-subtitle {
position: absolute;
top: 50px;
left: 300px;
color: #eee;
font-family: sans-serif;
font-size: 20px;
font-weight: 800;
text-decoration: none;
margin-left: 20px;
margin-top: 6px;
color: #fff;
}
#header-menu li {
display: inline;
font-size: 23px;
font-weight: 700;
margin-left: 10px;
}
#header-menu {
float: right;
padding-right: 20px;
list-style-type: none;
}
#header-menu a {
color: #ccc;
text-decoration: none;
-moz-transition-property: all;
-moz-transition-duration: 0.15s;
-moz-transition-timing-function: ease-out;
-webkit-transition: all 0.15s ease-out;
}
#header-menu a:hover {
color: #fff;
}
#submenu {
margin-left: 20px;
padding: 0px;
}
#submenu ul {
padding-left: 0px;
padding-top: 16px;
margin: 0px;
margin-left: 12px;
padding-bottom: 2px;
}
#submenu li {
display: inline;
padding-top: 2px;
padding-bottom: 3px;
padding-left: 12px;
padding-right: 12px;
border-radius: 4px 4px 0 0;
margin-right: 12px;
background: #dddddd; /* Old browsers */
background: -moz-linear-gradient(top, #dddddd 0%, #dddddd 19%, #aaa7a7 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dddddd), color-stop(19%,#dddddd), color-stop(100%,#aaa7a7)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #dddddd 0%,#dddddd 19%,#aaa7a7 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #dddddd 0%,#dddddd 19%,#aaa7a7 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #dddddd 0%,#dddddd 19%,#aaa7a7 100%); /* IE10+ */
background: linear-gradient(to bottom, #dddddd 0%,#dddddd 19%,#aaa7a7 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dddddd', endColorstr='#aaa7a7',GradientType=0 ); /* IE6-9 */
}
#submenu a {
font-size: 14px;
font-weight: bold;
color: #222;
text-decoration: none;
}
#rotimage {
background-image: url("../img/rot-1.jpg");
width: 1024px;
height: 100px;
background-position: center;
border-bottom: 1px solid black;
position: relative;
}
#main {
margin-left: auto;
margin-right: auto;
width: 1024px;
color: #222;
}
#content {
background-color: #eee;
padding: 10px 5px 5px 5px;
}
#content h2 {
margin: 0px;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-size: 20px;
font-weight: 800;
}
#content h3 {
margin: 0px;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-size: 24px;
font-weight: 800;
padding-left: 25px;
padding-top: 5px;
padding-bottom: 3px;
}
#content h1 {
margin: 0px;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-size: 32px;
font-weight: 800;
padding-left: 25px;
padding-top: 15px;
padding-bottom: 10px;
}
#content p {
font-family: georgia, serif;
margin: 0px;
font-size: 16px;
text-align: justify;
line-height: 26px;
padding: 15px;
}
#content ul {
font-family: georgia, serif;
font-size: 16px;
}
#content li {
margin-bottom: 4px;
}
div.quote {
background-color: #e9e9e9;
margin: 0px 5px 5px 5px;
}
div.quoteheader {
padding: 4px 4px 4px 10px;
background-color: #ddd;
font-size: 12px;
}
div.quote:hover {
background-color: #ededed;
}
p.quotetext {
font-family: Terminus, Consolas, Monaco, Courier New, monospace !important;
font-size: 14px !important;
padding: 8px !important;
}
div.quoteheader a {
text-decoration: none;
color: #444;
font-weight: bold;
}
div.quoteheader a:hover {
color: #806060;
text-decoration: underline;
}
footer {
text-align: center;
margin-top: 10px;
margin-bottom: 5px;
}
.sidebox {
width: 400px;
float: right;
margin-left: 25px;
margin-right: 20px;
margin-top: 15px;
}
h2 a {
text-decoration: none;
color: #222;
}
form {
font-size: 12px;
padding: 0 16px 0 16px;
}
div.form-label {
margin-right: 10px;
}
div.form-element {
}
div.form-element input {
width: 100%;
margin-bottom: 10px;
}
div.form-element textarea {
width: 100%;
height: 400px;
margin-bottom: 10px;
}
input.form-submit {
display: block;
margin: 0 0 10px 10px;
}

BIN
webapp/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

36
webapp/static/humans.txt Normal file
View File

@ -0,0 +1,36 @@
/* the humans responsible & colophon */
/* humanstxt.org */
/* TEAM */
html, gfx: q3k (q3k@hackerspace.pl)
/* SITE */
Standards: HTML5, CSS3
Components: Modernizr, jQuery
Software: html5boilerplate ;)
-o/-
+oo//-
:ooo+//:
-ooooo///-
/oooooo//:
:ooooooo+//-
-+oooooooo///-
-://////////////+oooooooooo++////////////::
:+ooooooooooooooooooooooooooooooooooooo+:::-
-/+ooooooooooooooooooooooooooooooo+/::////:-
-:+oooooooooooooooooooooooooooo/::///////:-
--/+ooooooooooooooooooooo+::://////:-
-:+ooooooooooooooooo+:://////:--
/ooooooooooooooooo+//////:-
-ooooooooooooooooooo////-
/ooooooooo+oooooooooo//:
:ooooooo+/::/+oooooooo+//-
-oooooo/::///////+oooooo///-
/ooo+::://////:---:/+oooo//:
-o+/::///////:- -:/+o+//-
:-:///////:- -:/://
-////:- --//:
-- -:

0
webapp/static/img/.gitignore vendored Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="331.26981" height="212.02559" id="svg2" version="1.1" inkscape:version="0.48.0 r9654" sodipodi:docname="hackerspace.svg">
<defs id="defs4"/>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1" inkscape:cx="201.24841" inkscape:cy="181.48736" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" inkscape:window-width="1280" inkscape:window-height="745" inkscape:window-x="-4" inkscape:window-y="-3" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:snap-global="false">
<inkscape:grid type="xygrid" id="grid2985" empspacing="5" visible="true" enabled="true" snapvisiblegridlinesonly="true"/>
</sodipodi:namedview>
<metadata id="metadata7">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(-2590.4097,-1085.9295)">
<flowRoot xml:space="preserve" id="flowRoot5483" style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:FreeSans"><flowRegion id="flowRegion5485"><rect id="rect5487" width="1572" height="676" x="940" y="1108.3622"/></flowRegion><flowPara id="flowPara5489"/></flowRoot> <flowRoot xml:space="preserve" id="flowRoot5491" style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:FreeSans"><flowRegion id="flowRegion5493"><rect id="rect5495" width="1976" height="788" x="904" y="124.36219"/></flowRegion><flowPara id="flowPara5497"/></flowRoot> <path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2377.5571,666.24582)" sodipodi:type="star" style="fill:#ffffff;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-8-6-0-8-8-3" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path sodipodi:type="star" style="fill:#ffffff;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-6-6-6-0" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" transform="matrix(-0.5,0.8660254,0.8660254,0.5,2413.9827,730.22025)" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2376.9827,794.30613)" sodipodi:type="star" style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-8-1-6-8-9" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2450.9827,666.13437)" sodipodi:type="star" style="fill:#ffffff;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-8-6-1-5-9-5" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path sodipodi:type="star" style="fill:#ffffff;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-85-7-6-0" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" transform="matrix(-0.5,0.8660254,0.8660254,0.5,2487.2218,729.9882)" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2450.2218,794.07408)" sodipodi:type="star" style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-8-4-6-1-59" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2524.2218,665.90232)" sodipodi:type="star" style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-8-6-02-8-8-46" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path sodipodi:type="star" style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-6-9-4-8-2" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" transform="matrix(-0.5,0.8660254,0.8660254,0.5,2524.1474,794.03114)" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2598.3269,666.17028)" sodipodi:type="star" style="fill:#ffffff;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-2-8-1-7-7-7" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2597.8936,793.67731)" sodipodi:type="star" style="fill:#ffffff;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-8-6-5-2-12" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2561.1474,729.94526)" sodipodi:type="star" style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-8-6-02-8-8-46-7" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
<path transform="matrix(-0.5,0.8660254,0.8660254,0.5,2635.2525,730.21322)" sodipodi:type="star" style="fill:#ffffff;stroke:#000000;stroke-width:3;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path4509-2-8-1-7-7-7-8" sodipodi:sides="6" sodipodi:cx="275" sodipodi:cy="447.36218" sodipodi:r1="40.311291" sodipodi:r2="34.910599" sodipodi:arg1="0.51914611" sodipodi:arg2="1.0427449" inkscape:flatsided="true" inkscape:rounded="0" inkscape:randomized="0" d="m 310,467.36218 -34.82051,20.31089 -35,-20 L 240,427.36218 l 34.82051,-20.31089 35,20 z" inkscape:export-filename="/home/mmacias/hs_waw_hexglider3\.png" inkscape:export-xdpi="100" inkscape:export-ydpi="100"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

BIN
webapp/static/img/mapka.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 KiB

BIN
webapp/static/img/rot-1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
webapp/static/img/rot-2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
webapp/static/img/rpt-2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

9266
webapp/static/js/libs/jquery-1.7.1.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,138 @@
/**
* jQuery.timers - Timer abstractions for jQuery
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2009/10/16
*
* @author Blair Mitchelmore
* @version 1.2
*
**/
jQuery.fn.extend({
everyTime: function(interval, label, fn, times) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, times);
});
},
oneTime: function(interval, label, fn) {
return this.each(function() {
jQuery.timer.add(this, interval, label, fn, 1);
});
},
stopTime: function(label, fn) {
return this.each(function() {
jQuery.timer.remove(this, label, fn);
});
}
});
jQuery.extend({
timer: {
global: [],
guid: 1,
dataKey: "jQuery.timer",
regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
powers: {
// Yeah this is major overkill...
'ms': 1,
'cs': 10,
'ds': 100,
's': 1000,
'das': 10000,
'hs': 100000,
'ks': 1000000
},
timeParse: function(value) {
if (value == undefined || value == null)
return null;
var result = this.regex.exec(jQuery.trim(value.toString()));
if (result[2]) {
var num = parseFloat(result[1]);
var mult = this.powers[result[2]] || 1;
return num * mult;
} else {
return value;
}
},
add: function(element, interval, label, fn, times) {
var counter = 0;
if (jQuery.isFunction(label)) {
if (!times)
times = fn;
fn = label;
label = interval;
}
interval = jQuery.timer.timeParse(interval);
if (typeof interval != 'number' || isNaN(interval) || interval < 0)
return;
if (typeof times != 'number' || isNaN(times) || times < 0)
times = 0;
times = times || 0;
var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
if (!timers[label])
timers[label] = {};
fn.timerID = fn.timerID || this.guid++;
var handler = function() {
if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
jQuery.timer.remove(element, label, fn);
};
handler.timerID = fn.timerID;
if (!timers[label][fn.timerID])
timers[label][fn.timerID] = window.setInterval(handler,interval);
this.global.push( element );
},
remove: function(element, label, fn) {
var timers = jQuery.data(element, this.dataKey), ret;
if ( timers ) {
if (!label) {
for ( label in timers )
this.remove(element, label, fn);
} else if ( timers[label] ) {
if ( fn ) {
if ( fn.timerID ) {
window.clearInterval(timers[label][fn.timerID]);
delete timers[label][fn.timerID];
}
} else {
for ( var fn in timers[label] ) {
window.clearInterval(timers[label][fn]);
delete timers[label][fn];
}
}
for ( ret in timers[label] ) break;
if ( !ret ) {
ret = null;
delete timers[label];
}
}
for ( ret in timers ) break;
if ( !ret )
jQuery.removeData(element, this.dataKey);
}
}
}
});
jQuery(window).bind("unload", function() {
jQuery.each(jQuery.timer.global, function(index, item) {
jQuery.timer.remove(item);
});
});

File diff suppressed because one or more lines are too long

93
webapp/static/js/map.js Normal file
View File

@ -0,0 +1,93 @@
/** include - including .js files from JS - bfults@gmail.com - 2005-02-09 **
** Code licensed under Creative Commons Attribution-ShareAlike License **
** http://creativecommons.org/licenses/by-sa/2.0/ **/
var hIncludes = null;
function include(sURI, cls, id, ignore_duplicates)
{
if (document.getElementsByTagName) {
if (!ignore_duplicates && !hIncludes) {
hIncludes = {};
var cScripts = document.getElementsByTagName("script");
for (var i=0,len=cScripts.length; i < len; i++)
if (cScripts[i].src) hIncludes[cScripts[i].src] = cScripts[i];
}
if (ignore_duplicates || !hIncludes[sURI]) {
var oNew = document.createElement("script");
oNew.type = "text/javascript";
oNew.src = sURI;
if (cls != undefined) oNew.className = cls;
if (id != undefined) oNew.id = id;
if (hIncludes != undefined) hIncludes[sURI]=true;
document.getElementsByTagName("head")[0].appendChild(oNew);
}
return (ignore_duplicates || hIncludes[sURI]);
}
return false
}
/* code borrowed from rysiek at brama. */
include('/js/openlayers/OpenLayers.js', 'js-libs');
var osm, map, markers_layer, zoom, center, brama_pos, epsg4326;
function initOpenLayersMap(mapobj) {
zoom = 16
center = new OpenLayers.LonLat(21.002971, 52.246246);
hs_pos = new OpenLayers.LonLat(21.002971, 52.246246);
epsg4326 = new OpenLayers.Projection("EPSG:4326");
map = new OpenLayers.Map(mapobj, {maxResolution: 0.703125});
osm = new OpenLayers.Layer.OSM.Mapnik("OpenStreetMap (Mapnik)", {
displayOutsideMaxExtent: true,
wrapDateLine: true,
buffer: 0
});
map.addLayer(osm);
map.setCenter(center.clone().transform(epsg4326, map.getProjectionObject()), zoom);
markers_layer = new OpenLayers.Layer.Markers("Markery");
var icon_size = new OpenLayers.Size(50, 30);
var icon_offset = new OpenLayers.Pixel(-(icon_size.w/2), -(icon_size.h/2));
var hs = new OpenLayers.Marker(
hs_pos.clone().transform(epsg4326, map.getProjectionObject()),
new OpenLayers.Icon('/img/hackerspace.svg', icon_size, icon_offset)
);
markers_layer.setVisibility(true);
markers_layer.addMarker(hs);
map.addLayer(markers_layer);
}
var map_attempt_timeout = 500;
var map_attempts_no = 30;
function mapInitAttempt() {
if ( (typeof OpenLayers != 'undefined') && (typeof OpenLayers.Layer.OSM.Mapnik != 'undefined') ) {
$(this).stopTime()
$('#map img').fadeOut('fast', function(){
$("#map").addClass('osm')
initOpenLayersMap("map")
});
} else {
if ( ($("script[src='/js/openlayers/openstreetmap.js']").length == 0) && (typeof OpenLayers != 'undefined') && (typeof OpenLayers.Layer.OSM.Mapnik == 'undefined') ) {
include('/js/openlayers/openstreetmap.js', 'js-libs');
}
map_attempts_no--
if (map_attempts_no > 0) {
if (typeof console != 'undefined') console.debug('OSM/OL :: not yet... (' + map_attempts_no + ' attempts left)')
} else {
$(this).stopTime()
if (typeof console != 'undefined') console.debug('OSM/OL :: not yet... cancelling.')
}
}
}
$(document).ready(function(){
$(this).everyTime(map_attempt_timeout, mapInitAttempt);
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,141 @@
/**
* Namespace: Util.OSM
*/
OpenLayers.Util.OSM = {};
/**
* Constant: MISSING_TILE_URL
* {String} URL of image to display for missing tiles
*/
OpenLayers.Util.OSM.MISSING_TILE_URL = "http://openstreetmap.org/openlayers/img/404.png";
/**
* Property: originalOnImageLoadError
* {Function} Original onImageLoadError function.
*/
OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
/**
* Function: onImageLoadError
*/
OpenLayers.Util.onImageLoadError = function() {
if (this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) {
this.src = OpenLayers.Util.OSM.MISSING_TILE_URL;
} else if (this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)) {
// do nothing - this layer is transparent
} else {
OpenLayers.Util.OSM.originalOnImageLoadError;
}
};
/**
* Class: OpenLayers.Layer.OSM.Mapnik
*
* Inherits from:
* - <OpenLayers.Layer.OSM>
*/
OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
/**
* Constructor: OpenLayers.Layer.OSM.Mapnik
*
* Parameters:
* name - {String}
* options - {Object} Hashtable of extra options to tag onto the layer
*/
initialize: function(name, options) {
var url = [
"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
"http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
"http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
var newArguments = [name, url, options];
OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
},
CLASS_NAME: "OpenLayers.Layer.OSM.Mapnik"
});
/**
* Class: OpenLayers.Layer.OSM.Osmarender
*
* Inherits from:
* - <OpenLayers.Layer.OSM>
*/
OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, {
/**
* Constructor: OpenLayers.Layer.OSM.Osmarender
*
* Parameters:
* name - {String}
* options - {Object} Hashtable of extra options to tag onto the layer
*/
initialize: function(name, options) {
var url = [
"http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
"http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
"http://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({ numZoomLevels: 18 }, options);
var newArguments = [name, url, options];
OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
},
CLASS_NAME: "OpenLayers.Layer.OSM.Osmarender"
});
/**
* Class: OpenLayers.Layer.OSM.CycleMap
*
* Inherits from:
* - <OpenLayers.Layer.OSM>
*/
OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
/**
* Constructor: OpenLayers.Layer.OSM.CycleMap
*
* Parameters:
* name - {String}
* options - {Object} Hashtable of extra options to tag onto the layer
*/
initialize: function(name, options) {
var url = [
"http://a.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png",
"http://b.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png",
"http://c.andy.sandbox.cloudmade.com/tiles/cycle/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
var newArguments = [name, url, options];
OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
},
CLASS_NAME: "OpenLayers.Layer.OSM.CycleMap"
});
/**
* Class: OpenLayers.Layer.OSM.Maplint
*
* Inherits from:
* - <OpenLayers.Layer.OSM>
*/
OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, {
/**
* Constructor: OpenLayers.Layer.OSM.Maplint
*
* Parameters:
* name - {String}
* options - {Object} Hashtable of extra options to tag onto the layer
*/
initialize: function(name, options) {
var url = [
"http://d.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
"http://e.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
"http://f.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({ numZoomLevels: 18, isBaseLayer: false, visibility: false }, options);
var newArguments = [name, url, options];
OpenLayers.Layer.OSM.prototype.initialize.apply(this, newArguments);
},
CLASS_NAME: "OpenLayers.Layer.OSM.Maplint"
});

View File

@ -0,0 +1,5 @@
window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; args.callee = args.callee.caller; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}};
(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}})
(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}());

View File

@ -0,0 +1,60 @@
/* hackerspace.pl js
* by q3k@hackerspace.pl et al
*
* cc by-nc-sa */
$(function(){
var rotimageMoving = false;
$("#rotimage").mouseover(function() {
if (!rotimageMoving)
{
rotimageMoving = true;
$("#rotimage").animate({
height: "200px",
}, 300, "swing", function() {
rotimageMoving = false;
});
}
});
$("#rotimage").mouseout(function() {
if (!rotimageMoving)
{
rotimageMoving = true;
$("#rotimage").animate({
height: "100px",
}, 300, "swing", function() {
rotimageMoving = false;
});
}
});
$.get("/at", function(data) {
var jdata = JSON.parse(data);
var users = jdata.users.length;
if (users > 0)
{
var text = 'According to <a href="http://at.hackerspace.pl">our instruments</a> there ';
if (users == 1)
text += 'is one person';
else
text += 'are ' + users + ' people';
text += ' at the hackerspace right now.';
$("#status-tooltip p").html(text);
$("#status img").attr("src", "/img/status-open.png");
$("#status-tooltip").css("display", "block");
$("#status").css("display", "block");
}
else
{
$("#status img").attr("src", "/img/status-closed.png");
$("#status").css("display", "block");
}
});
});

4
webapp/static/robots.txt Normal file
View File

@ -0,0 +1,4 @@
# www.robotstxt.org/
# http://code.google.com/web/controlcrawlindex/
User-agent: *

View File

@ -0,0 +1,5 @@
[uwsgi]
http = 0.0.0.0:9091
master = true
module = static
callable = app

View File

@ -0,0 +1,13 @@
from flask import Flask, render_template
import urllib
app = Flask(__name__, static_folder='../', static_url_path='', template_folder='../')
@app.route('/')
def index():
return render_template('index.html')
@app.route('/at')
def at():
return urllib.urlopen("http://at.hackerspace.pl/api").read()
app.run()

Binary file not shown.

View File

@ -0,0 +1,12 @@
{% macro render_field(field) %}
<div class="form-label">{{ field.label }}</div>
<div class="form-element">{{ field(**kwargs)|safe }}
{% if field.errors %}
<ul class="form-errors">
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endmacro %}

View File

@ -0,0 +1,64 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{% block title %}{% endblock title %}</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/static/css/style.css">
<script src="/static/js/libs/modernizr-2.5.3.min.js"></script>
</head>
<body>
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<header>
<img id="header-glider" src="/static/img/hackerspace.svg" />
<a id="header-hackerspacepl" href="https://hackerspace.pl/">Warsaw Hackerspace</a>
<a id="header-subtitle" href="/">Quote Database</a>
<ul id="header-menu">
<li><a href="https://hackerspace.pl/">about</a></li>
<li><a href="https://blog.hackerspace.pl">blog</a></li>
<li><a href="https://wiki.hackerspace.pl">wiki</a></li>
<li><a href="http://code.hackerspace.pl/">code</a></li>
</ul>
</header>
<div role="main" id="main">
<div id="submenu">
<ul>
<li><a href="/quotes/">Browse</a>
<li><a href="/new">Submit</a>
<li><a href="/quotes/top">Top</a>
<li><a href="/quotes/queue">Queue</a>
<li><a href="/quotes/bottom">Worst</a>
</div>
<div id="content">
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class="flashes">
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
{% endif %}
</ul>
{% endwith %}
{% block content %}{% endblock %}
</div>
</div>
<footer>
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/static/js/libs/jquery-1.7.1.min.js"><\/script>')</script>
<script src="/static/js/libs/jquery.timers.js"></script>
<script src="/static/js/plugins.js"></script>
<script src="/static/js/script.js"></script>
<script src="/static/js/map.js"></script>
</body>
</html>

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<h3 style="margin-bottom: 10px;">{{ title }}:</h3>
{% for quote in quotes %}
<div class="quote">
<div class ="quoteheader">
<a href="/quotes/view/{{ quote.id }}">#{{ quote.id }}</a>
<a href="/quotes/up/{{ quote.id }}">Up↑</a>
{{ quote.score}} / {{ quote.votes }}
<a href="/quotes/down/{{ quote.id }}">Down↓</a>
{{ quote.date }}
</div>
<p class="quotetext">{{ quote.text }}</p>
</div>
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% from "_formhelpers.html" import render_field %}
{% block title %}Submit Quote{% endblock %}
{% block content %}
<h3>Submit Quote:</h3>
<form method="post" action="/new">
{{ render_field(form.text) }}
{{ render_field(form.meta) }}
<input class="form-submit" type="submit" value="Submit Quote" />
</form>
{% endblock %}

41
webapp/views.py Normal file
View File

@ -0,0 +1,41 @@
import flask
import time
from webapp import app, config, database, forms
def get_quotes():
quotes = []
for _id, _up, _down, _text, _meta, _date in database.fetchall():
quote = {}
quote["id"] = str(_id)
score = _up - _down
quote["score"] = "+" if score >= 0 else "-"
quote["score"] += str(score)
quote["votes"] = str(_up + _down)
quote["date"] = time.strftime("%y-%m-%d %H:%M %Z", time.localtime(_date))
quote["text"] = _text
quotes.append(quote)
return quotes
@app.route("/quotes/")
def recent_quotes():
database.execute("SELECT _id, _up, _down, _text, _meta, _date FROM quotes WHERE _approved = 1;")
quotes = get_quotes()
return flask.render_template("list.html", quotes=quotes, title="Recent Quotes")
@app.route("/quotes/queue")
def queue_quotes():
database.execute("SELECT _id, _up, _down, _text, _meta, _date FROM quotes WHERE _approved = 0;")
quotes = get_quotes()
return flask.render_template("list.html", quotes=quotes, title="Moderation Queue")
@app.route("/new", methods=["GET", "POST"])
def new_quote():
form = forms.NewQuote(flask.request.form)
if flask.request.method == "POST" and form.validate():
database.execute("INSERT INTO quotes (_text, _meta, _date) VALUES (?, ?, ?);", form.text.data, form.meta.data, time.time())
flask.flash("Quote added to mdoeration queue.")
return flask.redirect(flask.url_for('recent_quotes'))
return flask.render_template('new_quote.html', form=form)