summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2016-07-04 23:19:48 +0100
committerAndy Williams <andy@andywilliams.me>2016-07-04 23:19:48 +0100
commit4f8ae0fcffa421e249c212138bde9fbb1760041d (patch)
tree0a60757561de6ac7509b45842a78460278935eeb
parenta76d276883d6615ac533eada92eb8cf7064b2fb9 (diff)
Tidy after bad merge
-rw-r--r--app.py46
-rw-r--r--templates/about.html9
-rw-r--r--templates/layout.html101
-rw-r--r--templates/theme.html3
-rw-r--r--templates/themes.html11
-rw-r--r--templates/welcome.html11
6 files changed, 0 insertions, 181 deletions
diff --git a/app.py b/app.py
deleted file mode 100644
index 3127b5c..0000000
--- a/app.py
+++ /dev/null
@@ -1,46 +0,0 @@
1from flask import Flask
2from flask import abort, render_template
3from flask_restful import Resource, Api, abort as api_abort
4
5app = Flask(__name__)
6api = Api(app)
7
8@app.route('/')
9def welcome():
10 return render_template('welcome.html')
11
12@app.route('/about/')
13def about():
14 return render_template('about.html')
15
16THEMES = {
17 '1': {'theme_id': '1'},
18 'a': {'theme_id': 'a'},
19}
20
21class ThemeList(Resource):
22 def get(self):
23 return THEMES
24
25class Theme(Resource):
26 def get(self, theme_id):
27 if theme_id not in THEMES:
28 api_abort(404, message="Theme {} not found".format(theme_id))
29
30 return THEMES[theme_id]
31
32@app.route('/themes/')
33@app.route('/themes/<theme_id>')
34def themes(theme_id=None):
35 if theme_id:
36 if theme_id not in THEMES:
37 abort(404)
38 return render_template('theme.html', theme_id=theme_id)
39 else:
40 return render_template('themes.html', themes=THEMES)
41
42api.add_resource(ThemeList, '/v1/themes/')
43api.add_resource(Theme, '/v1/themes/<string:theme_id>')
44
45if __name__ == '__main__':
46 app.run(debug=True)
diff --git a/templates/about.html b/templates/about.html
deleted file mode 100644
index 2b840cd..0000000
--- a/templates/about.html
+++ /dev/null
@@ -1,9 +0,0 @@
1{% extends "layout.html" %}
2{% block title %}About{% endblock %}
3{% block heading %}About{% endblock %}
4
5{% block content %}
6<p>Extra is an Enlightenment site for discovering and downloading themes
7and other great add-ons to the Enlightenment desktop.</p>
8{% endblock %}
9
diff --git a/templates/layout.html b/templates/layout.html
deleted file mode 100644
index a1eaa4e..0000000
--- a/templates/layout.html
+++ /dev/null
@@ -1,101 +0,0 @@
1<!DOCTYPE html>
2<html lang="en" dir="ltr">
3<head>
4 <meta charset="UTF-8" />
5 <title>{% block title %}{% endblock %} - Extra Enlightenment</title>
6 <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
7 <meta name="generator" content="DokuWiki"http://enlightenment.org/>
8<meta name="robots" content="index,follow"http://enlightenment.org/>
9<meta name="keywords" content="start"http://enlightenment.org/>
10<link rel="search" type="application/opensearchdescription+xml" href="http://enlightenment.org/lib/exe/opensearch.php" title=""/>
11<link rel="start" href="http://enlightenment.org/"/>
12<link rel="contents" href="http://enlightenment.org/start?do=index" title="Sitemap"/>
13<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://enlightenment.org/feed.php"/>
14<link rel="alternate" type="application/rss+xml" title="Current namespace" href="http://enlightenment.org/feed.php?mode=list&amp;ns="/>
15<link rel="edit" title="Edit this page" href="http://enlightenment.org/start?do=edit"/>
16<link rel="alternate" type="text/html" title="Plain HTML" href="http://enlightenment.org/_export/xhtml/start"/>
17<link rel="alternate" type="text/plain" title="Wiki Markup" href="http://enlightenment.org/_export/raw/start"/>
18<link rel="canonical" href="https://www.enlightenment.org/"http://enlightenment.org/>
19<link rel="stylesheet" type="text/css" href="http://enlightenment.org/lib/exe/css.php?t=e&amp;tseed=905991e55e329084d608eaa4c2a5f680"/>
20<script type="text/javascript">/*<![CDATA[*/var NS='';var SIG=' --- //[[andy@andywilliams.me|Andrew Williams]] //';var JSINFO = {"id":"start","namespace":"","plugin_folded":{"hide":"hide","reveal":"reveal"}};
21/*!]]>*/</script>
22<script type="text/javascript" charset="utf-8" src="http://enlightenment.org/lib/exe/js.php?tseed=905991e55e329084d608eaa4c2a5f680"></script>
23 <meta name="viewport" content="width=device-width,initial-scale=1" />
24 <link rel="shortcut icon" href="http://enlightenment.org/lib/tpl/e/images/favicon.ico" />
25<link rel="apple-touch-icon" href="http://enlightenment.org/lib/tpl/e/images/apple-touch-icon.png" />
26 <!-- meta content goes here -->
27 <link href="http://enlightenment.org/lib/tpl/e/css/bootstrap-default.min.css" rel="stylesheet">
28 <link href="http://enlightenment.org/lib/tpl/e/css/modifications.css" rel="stylesheet">
29 <script src="http://enlightenment.org/lib/tpl/e/js/bootstrap.min.js"></script>
30 <script src="http://enlightenment.org/lib/tpl/e/js/modifications.js"></script>
31 <link href='//fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
32 <link href='//fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
33</head>
34
35<body>
36
37 <div id="dokuwiki__site">
38 <div id="dokuwiki__top" class="dokuwiki site mode_show"></div>
39 <nav class="navbar navbar-inverse navbar-fixed-top">
40 <div class="container">
41 <div class="navbar-header">
42 <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
43 <span class="icon-bar"></span>
44 <span class="icon-bar"></span>
45 <span class="icon-bar"></span>
46 </button>
47 <a class="navbar-brand" href="https://enlightenment.org/"></a>
48 </div>
49 <div class="collapse navbar-collapse">
50 <ul class="nav navbar-nav navbar-left">
51 <li><a href="/">Home</a></li>
52<li><a href="/about/">About</a></li>
53<li><a href="/themes/">Themes</a></li>
54 </ul>
55 <ul class="nav navbar-nav navbar-right">
56<!--
57 <div class="navbar-form form-group" role="search">
58 <form action="http://enlightenment.org/start" accept-charset="utf-8" class="search" id="dw__search" method="get"><div class="no"><input type="hidden" name="do" value="search" /><input class="" type="text" placeholder="Search" autocomplete="off" id="qsearch__in" accesskey="f" name="id" class="edit" title="[F]" /><button type="submit" value="" class="btn btn-default" title="Search"><i class="glyphicon glyphicon-search"></i></button></div></form> </div>
59-->
60 </li>
61 </ul>
62 </div>
63 </div> <!-- container -->
64 </nav> <!-- navbar -->
65
66
67 <div class="container">
68 <div class="row">
69 <div class="col-md-11" id="dokuwiki__content">
70 <div class="page">
71<h3>{% block heading %}{% endblock %}</h3>
72<div class="level3">
73
74{% block content %}TODO{% endblock %}
75
76</div>
77
78 </div>
79 </div>
80 </div><!-- row -->
81 </div><!-- container -->
82
83 <div class="clearer"></div>
84 <hr class="a11y" />
85
86 <!-- ********** FOOTER ********** -->
87 <footer>
88 <div class="clearer"></div>
89 <div class="container">
90 <div class="row">
91 <div class="col-md-11 text-muted text-right">
92 </div>
93 </div>
94 </div>
95 </footer>
96
97 </div>
98
99</body>
100</html>
101
diff --git a/templates/theme.html b/templates/theme.html
deleted file mode 100644
index 9ac19a5..0000000
--- a/templates/theme.html
+++ /dev/null
@@ -1,3 +0,0 @@
1{% extends "layout.html" %}
2{% block title %}Theme {{ theme_id }}{% endblock %}
3{% block heading %}Theme - {{ theme_id }}{% endblock %}
diff --git a/templates/themes.html b/templates/themes.html
deleted file mode 100644
index aa6eb4c..0000000
--- a/templates/themes.html
+++ /dev/null
@@ -1,11 +0,0 @@
1{% extends "layout.html" %}
2{% block title %}Themes{% endblock %}
3{% block heading %}Themes{% endblock %}
4
5{% block content %}
6<ul>
7{% for theme_id in themes %}
8 <li><a href="{{ theme_id }}">theme {{ themes[theme_id].theme_id }}</a></li>
9{% endfor %}
10</ul>
11{% endblock %}
diff --git a/templates/welcome.html b/templates/welcome.html
deleted file mode 100644
index 8022e01..0000000
--- a/templates/welcome.html
+++ /dev/null
@@ -1,11 +0,0 @@
1{% extends "layout.html" %}
2{% block title %}Welcome{% endblock %}
3{% block heading %}Welcome{% endblock %}
4
5{% block content %}
6<ul>
7 <li><a href="/themes/">Themes</a></li>
8</ul>
9
10<p><a href="/about/">About</a> Extra Enlightenment.</p>
11{% endblock %}