Created
August 19, 2014 02:01
-
-
Save qpfiffer/c46d3bd520bf5069beda to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 79fd3be9b41c343b60b7d52dd071c7510cbde229 Mon Sep 17 00:00:00 2001 | |
From: Quinlan Pfiffer <[email protected]> | |
Date: Mon, 18 Aug 2014 18:30:46 -0700 | |
Subject: [PATCH 1/2] Casio watches | |
--- | |
.gitignore | 1 + | |
requirements.txt | 2 ++ | |
2 files changed, 3 insertions(+) | |
create mode 100644 .gitignore | |
create mode 100644 requirements.txt | |
diff --git a/.gitignore b/.gitignore | |
new file mode 100644 | |
index 0000000..0d20b64 | |
--- /dev/null | |
+++ b/.gitignore | |
@@ -0,0 +1 @@ | |
+*.pyc | |
diff --git a/requirements.txt b/requirements.txt | |
new file mode 100644 | |
index 0000000..6783a69 | |
--- /dev/null | |
+++ b/requirements.txt | |
@@ -0,0 +1,2 @@ | |
+jinja2 | |
+gspread | |
-- | |
1.7.9.5 | |
From 6e52e72acd61de8d99f6478ba36faeeb072cbdc7 Mon Sep 17 00:00:00 2001 | |
From: Quinlan Pfiffer <[email protected]> | |
Date: Mon, 18 Aug 2014 18:59:10 -0700 | |
Subject: [PATCH 2/2] Permalinks. Permanently. | |
--- | |
index.html | 4 ++-- | |
main.py | 5 +++++ | |
2 files changed, 7 insertions(+), 2 deletions(-) | |
diff --git a/index.html b/index.html | |
index 181ce16..56b116b 100644 | |
--- a/index.html | |
+++ b/index.html | |
@@ -44,7 +44,7 @@ | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> | |
- <a class="navbar-brand" href="#">Emoticon voting simulator 2014</a> | |
+ <a class="navbar-brand" href="/">Emoticon voting simulator 2014</a> | |
</div> | |
<div class="navbar-collapse collapse"> | |
<form class="navbar-form navbar-right" role="form"> | |
@@ -96,7 +96,7 @@ | |
<a class="down" href="/vote/down/{{emo.name|urlencode}}"><span class="glyphicon glyphicon-arrow-up"></span></a> | |
</td> | |
<td class="asdasd"> | |
- <code style="font-size: 48px">{{emo.name}}</code><br /> | |
+ <code style="font-size: 48px"><a style="color: #c7254e;" href="/permalink/{{emo.name}}">{{emo.name}}</a></code><br /> | |
</td> | |
</tr> | |
{% endfor %} | |
diff --git a/main.py b/main.py | |
index e2e7389..9342123 100644 | |
--- a/main.py | |
+++ b/main.py | |
@@ -36,6 +36,11 @@ def vote(where, what): | |
existing.commit() | |
return redirect("/") | |
+@route('/permalink/<what>') | |
+@view('index') | |
+def permalink(what): | |
+ return dict(emoticons=[find_shit(get_all_shit(), what)]) | |
+ | |
@post('/add') | |
@view('index') | |
def add(): | |
-- | |
1.7.9.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment