updated with competition
|
@ -2,7 +2,7 @@
|
||||||
page_menu = [
|
page_menu = [
|
||||||
('Home', '/'),
|
('Home', '/'),
|
||||||
#('About', '#about'),
|
#('About', '#about'),
|
||||||
('Competition', '/competition'),
|
#~ ('Competition', '/competition'),
|
||||||
('Contact', '#mailing-list-signup')]
|
('Contact', '#mailing-list-signup')]
|
||||||
|
|
||||||
banner_images = [
|
banner_images = [
|
||||||
|
|
141
site/generate.py
|
@ -1,77 +1,16 @@
|
||||||
import argparse
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import requests
|
import codecs
|
||||||
import requests.exceptions
|
import argparse
|
||||||
from lxml import etree
|
|
||||||
import lxml
|
|
||||||
|
|
||||||
from scaffold.web import web as html
|
from scaffold.web import web as html
|
||||||
from scaffold.web import www
|
from scaffold.web import www
|
||||||
|
|
||||||
import constants as site
|
import constants as site
|
||||||
|
from pages import web
|
||||||
|
from pages import header, footer
|
||||||
|
from pages import blog
|
||||||
|
|
||||||
import codecs
|
|
||||||
|
|
||||||
from libs.rss_fetcher import feed_reader
|
|
||||||
|
|
||||||
web = html()
|
|
||||||
web.load_widgets('widgets')
|
|
||||||
web.template.create('Maidstone Hackspace', 'Hackspace for Maidstone, kent. for collaberation and discussion for artists, designers, makers, hackers, programmers, tinkerer, professionals and hobbyists.')
|
|
||||||
web.template.append('<link rel="icon" type="image/png" href="/static/template/images/icon.png">')
|
|
||||||
|
|
||||||
#paths
|
|
||||||
web.document_root = os.path.abspath('./')
|
|
||||||
web.template.domain = 'http://maidstone-hackspace.org.uk/'
|
|
||||||
web.template.theme_full_path = os.path.abspath('./static/template') + os.sep
|
|
||||||
domain = 'http://192.168.21.41:5000/'
|
|
||||||
image_path = domain + os.sep + 'template' + os.sep + 'images' + os.sep
|
|
||||||
|
|
||||||
web.template.css_includes.append('/static/template/default.css')
|
|
||||||
web.template.css_includes.append('/static/template/js/jquery-ui/themes/base/jquery-ui.css')
|
|
||||||
#~ web.template.javascript_includes.append('/static/template/js/jquery-ui/themes/base/jquery-ui.css')
|
|
||||||
|
|
||||||
def todict(data):
|
|
||||||
new_dict = {}
|
|
||||||
for key, value in data.items():
|
|
||||||
new_dict[key] = value
|
|
||||||
return new_dict
|
|
||||||
|
|
||||||
def dict_to_list(data, keys):
|
|
||||||
return [data.get(k) for k in keys]
|
|
||||||
|
|
||||||
#~ class page:
|
|
||||||
#~ def __enter__(self):
|
|
||||||
#~ header()
|
|
||||||
#~
|
|
||||||
#~ def __exit(self):
|
|
||||||
#~ footer()
|
|
||||||
|
|
||||||
def header():
|
|
||||||
# logo and social links at very top of the page
|
|
||||||
web.header_strip.create({})
|
|
||||||
web.header_strip.social(web.google_plus.create(web.template.domain, plus=True, share=False, comments=False).render())
|
|
||||||
web.template.body.append(web.header_strip.render())
|
|
||||||
|
|
||||||
# navigation
|
|
||||||
web.menu.create('/', 'leftNav')
|
|
||||||
web.menu * site.page_menu
|
|
||||||
web.template.body.append(web.menu.render())
|
|
||||||
|
|
||||||
# extra javascript libraries
|
|
||||||
web.template.javascript_includes.append('<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>')
|
|
||||||
web.template.javascript_includes.append('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>')
|
|
||||||
web.template.javascript_includes.append('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script>')
|
|
||||||
web.template.header.append('<link rel="icon" type="image/png" href="/static/images/favicon.png">')
|
|
||||||
|
|
||||||
def footer():
|
|
||||||
web.footer_content.create().append(
|
|
||||||
web.google_groups_signup.create(' and make yourself known','maidstone-hackspace').set_id('mailing-list-signup').render())
|
|
||||||
web.template.body.append(web.footer_content.render())
|
|
||||||
web.google_analytics.create('maidstone-hackspace.org.uk', 'UA-63373181-1')
|
|
||||||
web.template.body.append(web.google_analytics.render())
|
|
||||||
return web.render()
|
|
||||||
|
|
||||||
def examples():
|
def examples():
|
||||||
""" page for testing new components"""
|
""" page for testing new components"""
|
||||||
|
@ -92,8 +31,11 @@ def competition():
|
||||||
|
|
||||||
web.page.create(
|
web.page.create(
|
||||||
web.images.create(
|
web.images.create(
|
||||||
image='/static/template/images/hackspace-banner.png',
|
image='/static/images/competitions/screw_sorting_competition_banner.jpg',
|
||||||
title="Screw sorting competition banner").render())
|
title="Screw sorting competition banner"
|
||||||
|
).add_attributes('align', 'middle'
|
||||||
|
).add_attributes('style', 'margin:auto;display:block;width:500px;'
|
||||||
|
).render())
|
||||||
|
|
||||||
web.paragraph.create(
|
web.paragraph.create(
|
||||||
"""We are some friendly competitions, so if your not sure what to work on consider entering and win some swag.""")
|
"""We are some friendly competitions, so if your not sure what to work on consider entering and win some swag.""")
|
||||||
|
@ -106,7 +48,6 @@ def competition():
|
||||||
("Images can be design in any software or on a piece of paper but must be submitted as a jpg on the mailing list.", ),
|
("Images can be design in any software or on a piece of paper but must be submitted as a jpg on the mailing list.", ),
|
||||||
("stick figures and crude line drawing are fine, we are not judge your artistic ability.",)]
|
("stick figures and crude line drawing are fine, we are not judge your artistic ability.",)]
|
||||||
|
|
||||||
print bullet_list
|
|
||||||
web.list.create(ordered=False).set_classes('bullet-list')
|
web.list.create(ordered=False).set_classes('bullet-list')
|
||||||
web.list * bullet_list
|
web.list * bullet_list
|
||||||
web.page.section(web.list.render())
|
web.page.section(web.list.render())
|
||||||
|
@ -118,34 +59,6 @@ def competition():
|
||||||
return footer()
|
return footer()
|
||||||
|
|
||||||
|
|
||||||
def blogs():
|
|
||||||
""" page for testing new components"""
|
|
||||||
header()
|
|
||||||
web.page.create('blogs')
|
|
||||||
|
|
||||||
web.columns.create()
|
|
||||||
web.columns.append('test1')
|
|
||||||
web.columns.append('test2')
|
|
||||||
web.page.section(web.columns.render())
|
|
||||||
|
|
||||||
web.tiles.create()
|
|
||||||
feed = feed_reader(site.rss_feeds)
|
|
||||||
for row in feed:
|
|
||||||
print row.get('image')
|
|
||||||
web.tiles.append(
|
|
||||||
title = row.get('title'),
|
|
||||||
author = row.get('author'),
|
|
||||||
link = row.get('url'),
|
|
||||||
image = row.get('image'),
|
|
||||||
date = row.get('date'),
|
|
||||||
description = row.get('description'))
|
|
||||||
web.div.append(row)
|
|
||||||
web.page.section(web.tiles.render())
|
|
||||||
|
|
||||||
web.template.body.append(web.page.render())
|
|
||||||
return footer()
|
|
||||||
|
|
||||||
|
|
||||||
def index():
|
def index():
|
||||||
header()
|
header()
|
||||||
|
|
||||||
|
@ -160,7 +73,6 @@ def index():
|
||||||
'/static/template/images/tile-01.jpg'
|
'/static/template/images/tile-01.jpg'
|
||||||
).set_classes('tile-right').render())
|
).set_classes('tile-right').render())
|
||||||
web.banner_slider.reset()
|
web.banner_slider.reset()
|
||||||
print site.banner_images
|
|
||||||
web.banner_slider * site.banner_images
|
web.banner_slider * site.banner_images
|
||||||
|
|
||||||
web.page.append(web.banner_slider.render())
|
web.page.append(web.banner_slider.render())
|
||||||
|
@ -196,19 +108,19 @@ def index():
|
||||||
|
|
||||||
web.page.append(web.twitter_feed.render())
|
web.page.append(web.twitter_feed.render())
|
||||||
|
|
||||||
web.tiles.create()
|
#~ web.tiles.create()
|
||||||
feed = feed_reader(site.rss_feeds)
|
#~ feed = feed_reader(site.rss_feeds)
|
||||||
for row in feed:
|
#~ for row in feed:
|
||||||
print row.get('image')
|
#~ print row.get('image')
|
||||||
web.tiles.append(
|
#~ web.tiles.append(
|
||||||
title = row.get('title'),
|
#~ title = row.get('title'),
|
||||||
author = row.get('author'),
|
#~ author = row.get('author'),
|
||||||
link = row.get('url'),
|
#~ link = row.get('url'),
|
||||||
image = row.get('image'),
|
#~ image = row.get('image'),
|
||||||
date = row.get('date'),
|
#~ date = row.get('date'),
|
||||||
description = row.get('description'))
|
#~ description = row.get('description'))
|
||||||
web.div.append(row)
|
#~ web.div.append(row)
|
||||||
web.page.append(web.tiles.render())
|
#~ web.page.append(web.tiles.render())
|
||||||
|
|
||||||
web.template.body.append(web.page.render())
|
web.template.body.append(web.page.render())
|
||||||
|
|
||||||
|
@ -222,14 +134,13 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
with codecs.open('./html/index.html', 'w', "utf-8") as fp:
|
with codecs.open('./html/index.html', 'w', "utf-8") as fp:
|
||||||
fp.write(index().decode('utf-8'))
|
fp.write(index().decode('utf-8'))
|
||||||
|
|
||||||
#~ with open('./html/examples.html', 'w') as fp:
|
#~ with open('./html/examples.html', 'w') as fp:
|
||||||
#~ fp.write(examples())
|
#~ fp.write(examples())
|
||||||
|
|
||||||
with codecs.open('./html/blog.html', 'w', "utf-8") as fp:
|
with codecs.open('./html/blog.html', 'w', "utf-8") as fp:
|
||||||
fp.write(blogs().decode('utf-8'))
|
fp.write(blog.index().decode('utf-8'))
|
||||||
|
|
||||||
with codecs.open('./html/competition.html', 'w', "utf-8") as fp:
|
with codecs.open('./html/competition.html', 'w', "utf-8") as fp:
|
||||||
fp.write(competition().decode('utf-8'))
|
fp.write(competition().decode('utf-8'))
|
||||||
|
|
||||||
#~ file = codecs.open("lol", "w", "utf-8")
|
|
||||||
#~ file.write(u'\ufeff')
|
|
||||||
#~ file.close()
|
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:sa="/">
|
||||||
|
<head>
|
||||||
|
<link rel="icon" type="image/png" href="/static/images/favicon.png">
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/default.css" media="" type="text/css" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/js/jquery-ui/themes/base/jquery-ui.css" media="" type="text/css" />
|
||||||
|
|
||||||
|
<link rel="icon" type="image/png" href="/static/images/favicon.png">
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/default.css" media="" type="text/css" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/js/jquery-ui/themes/base/jquery-ui.css" media="" type="text/css" />
|
||||||
|
|
||||||
|
<link rel="icon" type="image/png" href="/static/images/favicon.png">
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/default.css" media="" type="text/css" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/js/jquery-ui/themes/base/jquery-ui.css" media="" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/static/js/jquery/jquery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script>
|
||||||
|
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script>
|
||||||
|
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script>
|
||||||
|
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="headerstrip"><nav class="navstrip"><div class="left mini-logo">Maidstone Hackspace</div><div class="social"><div size="standard" class="g-plusone" data-href="http://maidstone-hackspace.org.uk/" data-size="medium" data-annotation="inline" count="true"></div></div></nav></div>
|
||||||
|
<nav id="leftNav" class="menu" ><ul><li class="active mi0"><a href="/" >Home</a></li><li class="mi1"><a href="#mailing-list-signup" >Contact</a></li></ul><div style="clear:both;"></div></nav>
|
||||||
|
<div class="page" ><header class="pageHeader"><img src="/static/images/competitions/screw_sorting_competition_banner.jpg" alt="Screw sorting competition banner" align="middle" style="margin:auto;display:block;width:500px;" /></header><section class="pageSection"><p>We are some friendly competitions, so if your not sure what to work on consider entering and win some swag.The First cometition will be to design a device which can sort a jar of screws by size, the winning entry we will attempt to build.</p></section><section class="pageSection"><ul class="bullet-list" >
|
||||||
|
<li>Submit designs by some date here</li>
|
||||||
|
<li>Images can be design in any software or on a piece of paper but must be submitted as a jpg on the mailing list.</li>
|
||||||
|
<li>stick figures and crude line drawing are fine, we are not judge your artistic ability.</li>
|
||||||
|
</ul></section><footer class="pageFooter"></footer></div>
|
||||||
|
<div id="footer"><div id="footertop"></div><div id="footerbottom"><div class="container"><div class="copyright">©2015 Maidstone Hackspace</div><div id="mailing-list-signup" class="google-groups-signup"><h3>Signup and make yourself known</h3><form class="block" name="signup" method="get" action="http://groups.google.com/group/maidstone-hackspace/boxsubscribe"><label for="groups-email">Email Address</label><input id="groups-email" name="email" class="required"/><button type="submit" />Subscribe</button><a href="http://groups.google.com/group/maidstone-hackspace">Browse Archives</a></form><div style="clear:both;"></div><div></div></div><div>
|
||||||
|
<script type="text/javascript" ><!--//--><![CDATA[//><!--
|
||||||
|
//twitter code
|
||||||
|
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
|
||||||
|
ga('create', 'UA-63373181-1', 'maidstone-hackspace.org.uk');
|
||||||
|
|
||||||
|
ga('send', 'pageview');
|
||||||
|
|
||||||
|
var app = angular.module('myApp', ['ngAnimate']);
|
||||||
|
|
||||||
|
app.controller('sliderController', function($scope, $interval) {
|
||||||
|
$scope.currentSlide = 0;
|
||||||
|
$scope.autoSlide = true;
|
||||||
|
//$scope.length = 0;
|
||||||
|
|
||||||
|
$scope.next = function() {
|
||||||
|
$scope.autoSlide=false;
|
||||||
|
if ($scope.currentSlide < $scope.length - 1){
|
||||||
|
$scope.currentSlide += 1;
|
||||||
|
}else{
|
||||||
|
$scope.currentSlide = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.prev = function() {
|
||||||
|
$scope.autoSlide=false;
|
||||||
|
if ($scope.currentSlide > 0){
|
||||||
|
$scope.currentSlide -= 1;
|
||||||
|
}else{
|
||||||
|
$scope.currentSlide = $scope.length - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.isCurrentSlideIndex = function (index) {
|
||||||
|
return $scope.currentSlide === index;
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.loopSlides = function (index) {
|
||||||
|
if ($scope.autoSlide==false){return false;}
|
||||||
|
if ($scope.currentSlide < $scope.length - 1){
|
||||||
|
$scope.currentSlide += 1;
|
||||||
|
}else{
|
||||||
|
$scope.currentSlide = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$interval(function(){$scope.loopSlides();}, 5000);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//]]>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:sa="/">
|
||||||
|
<head>
|
||||||
|
<link rel="icon" type="image/png" href="/static/images/favicon.png">
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/default.css" media="" type="text/css" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" id="navigationCss" href="/static/template/js/jquery-ui/themes/base/jquery-ui.css" media="" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/static/js/jquery/jquery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>
|
||||||
|
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script>
|
||||||
|
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><title>Maidstone Hackspace</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta property="description" name="description" content="Hackspace for Maidstone, kent. for collaberation and discussion for artists, designers, makers, hackers, programmers, tinkerer, professionals and hobbyists." />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="headerstrip"><nav class="navstrip"><div class="left mini-logo">Maidstone Hackspace</div><div class="social"><div size="standard" class="g-plusone" data-href="http://maidstone-hackspace.org.uk/" data-size="medium" data-annotation="inline" count="true"></div></div></nav></div>
|
||||||
|
<nav id="leftNav" class="menu" ><ul><li class="active mi0"><a href="/" >Home</a></li><li class="mi1"><a href="#mailing-list-signup" >Contact</a></li></ul><div style="clear:both;"></div></nav>
|
||||||
|
<div id="headerstrip"><nav class="navstrip"><div class="left mini-logo">Maidstone Hackspace</div><div class="social"></div></nav></div>
|
||||||
|
<nav id="leftNav" class="menu" ><ul><li class="active mi0"><a href="/" >Home</a></li><li class="mi1"><a href="#mailing-list-signup" >Contact</a></li></ul><div style="clear:both;"></div></nav>
|
||||||
|
<div class="page" ><header class="pageHeader"></header><section class="pageSection"><img src="/static/template/images/tile-01.jpg" alt="" class="tile-right" />
|
||||||
|
<img src="/static/template/images/tile-01.jpg" alt="" class="tile-right" /><div class="banner-slide" ng-app="myApp" ng-controller="sliderController"><ul ng-switch on="currentSlide" ng-init="length=3;"><li class="slide" ng-switch-when="0"><img src="/static/template/images/hackspace-banner.png" /><div class="content">title<br />intro text</div></li><li class="slide" ng-switch-when="1"><img src="/static/template/images/example-01.jpg" /><div class="content">title<br />intro text</div></li><li class="slide" ng-switch-when="2"><img src="/static/template/images/example-02.jpg" /><div class="content">title<br />intro text</div></li><li style="clear:both;"></li></ul><div ng-click="prev()" title="Previous" role="button" class="slide-button left"><</div><div ng-click="next()" title="Next" role="button" class="slide-button right">></div></div><div class="clear"></div></section><section class="pageSection"><h2>Introduction</h2></section><section class="pageSection"><p>Hackspaces are a shared space where artists, designers, makers, hackers, programmers, tinkerers, professionals and hobbyists
|
||||||
|
can work on their projects, share knowledge and collaborate.We are in the process of developing Maidstone Hackspace. We're previous members of <span class="info" title="Innovation center medway prototype">(ICMP)</span> and looking to form a new space in the future.
|
||||||
|
At the moment, communication is via google groups, email, and the website. If you're at all intrested please join our <a href="#mailing-list-signup">mailing list</a>
|
||||||
|
and make yourself known!</p></section><section class="pageSection"><h2>Proposed activities</h2><ul >
|
||||||
|
<li>Workshop on building a mobile application which can run on ios and android,potentially game oriented for a bit of fun, but open to suggestions.</li>
|
||||||
|
<li>Build an interactive splash screen to feature on this site.</li>
|
||||||
|
<li><a title="Suggest a new activity" href="#mailing-list-signup" >Suggest a new activity</a></li>
|
||||||
|
</ul>
|
||||||
|
<div class="twitter-feed">
|
||||||
|
<a class="twitter-timeline" href="https://twitter.com/MHackspace" data-widget-id="606798560374484992">
|
||||||
|
Tweets by @MHackspace
|
||||||
|
</a>
|
||||||
|
</div></section><footer class="pageFooter"></footer></div>
|
||||||
|
<div id="footer"><div id="footertop"></div><div id="footerbottom"><div class="container"><div class="copyright">©2015 Maidstone Hackspace</div><div id="mailing-list-signup" class="google-groups-signup"><h3>Signup and make yourself known</h3><form class="block" name="signup" method="get" action="http://groups.google.com/group/maidstone-hackspace/boxsubscribe"><label for="groups-email">Email Address</label><input id="groups-email" name="email" class="required"/><button type="submit" />Subscribe</button><a href="http://groups.google.com/group/maidstone-hackspace">Browse Archives</a></form><div style="clear:both;"></div><div></div></div><div>
|
||||||
|
<script type="text/javascript" ><!--//--><![CDATA[//><!--
|
||||||
|
//twitter code
|
||||||
|
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
|
||||||
|
ga('create', 'UA-63373181-1', 'maidstone-hackspace.org.uk');
|
||||||
|
|
||||||
|
ga('send', 'pageview');
|
||||||
|
|
||||||
|
var app = angular.module('myApp', ['ngAnimate']);
|
||||||
|
|
||||||
|
app.controller('sliderController', function($scope, $interval) {
|
||||||
|
$scope.currentSlide = 0;
|
||||||
|
$scope.autoSlide = true;
|
||||||
|
//$scope.length = 0;
|
||||||
|
|
||||||
|
$scope.next = function() {
|
||||||
|
$scope.autoSlide=false;
|
||||||
|
if ($scope.currentSlide < $scope.length - 1){
|
||||||
|
$scope.currentSlide += 1;
|
||||||
|
}else{
|
||||||
|
$scope.currentSlide = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.prev = function() {
|
||||||
|
$scope.autoSlide=false;
|
||||||
|
if ($scope.currentSlide > 0){
|
||||||
|
$scope.currentSlide -= 1;
|
||||||
|
}else{
|
||||||
|
$scope.currentSlide = $scope.length - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.isCurrentSlideIndex = function (index) {
|
||||||
|
return $scope.currentSlide === index;
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.loopSlides = function (index) {
|
||||||
|
if ($scope.autoSlide==false){return false;}
|
||||||
|
if ($scope.currentSlide < $scope.length - 1){
|
||||||
|
$scope.currentSlide += 1;
|
||||||
|
}else{
|
||||||
|
$scope.currentSlide = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$interval(function(){$scope.loopSlides();}, 5000);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//]]>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -5,7 +5,8 @@ from lxml import etree
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask import make_response
|
from flask import make_response
|
||||||
|
|
||||||
import generate as pages
|
import generate
|
||||||
|
from pages import blog
|
||||||
|
|
||||||
|
|
||||||
web_app = Flask(__name__, static_url_path='/static')
|
web_app = Flask(__name__, static_url_path='/static')
|
||||||
|
@ -15,22 +16,22 @@ web_app = Flask(__name__, static_url_path='/static')
|
||||||
@web_app.route("/examples/", methods=['GET'])
|
@web_app.route("/examples/", methods=['GET'])
|
||||||
def examples():
|
def examples():
|
||||||
"""temporary for testing / examples"""
|
"""temporary for testing / examples"""
|
||||||
return make_response(pages.examples())
|
return make_response(generate.examples())
|
||||||
|
|
||||||
@web_app.route("/blogs/", methods=['GET'])
|
@web_app.route("/blogs/", methods=['GET'])
|
||||||
def blogs():
|
def blogs():
|
||||||
"""temporary for testing / examples"""
|
"""temporary for testing / examples"""
|
||||||
return make_response(pages.blogs())
|
return make_response(blog.index())
|
||||||
|
|
||||||
@web_app.route("/", methods=['GET'])
|
@web_app.route("/", methods=['GET'])
|
||||||
def index():
|
def index():
|
||||||
"""home page"""
|
"""home page"""
|
||||||
return make_response(pages.index())
|
return make_response(generate.index())
|
||||||
|
|
||||||
@web_app.route("/competition/", methods=['GET'])
|
@web_app.route("/competition/", methods=['GET'])
|
||||||
def competition():
|
def competition():
|
||||||
"""competition page"""
|
"""competition page"""
|
||||||
return make_response(pages.competition())
|
return make_response(generate.competition())
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
web_app.run(host='0.0.0.0', port=5000, debug=True)
|
web_app.run(host='0.0.0.0', port=5000, debug=True)
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
from libs.rss_fetcher import feed_reader
|
||||||
|
|
||||||
|
from scaffold.web import web as html
|
||||||
|
from scaffold.web import www
|
||||||
|
|
||||||
|
import constants as site
|
||||||
|
|
||||||
|
web = html()
|
||||||
|
web.load_widgets('widgets')
|
||||||
|
web.template.create('Maidstone Hackspace', 'Hackspace for Maidstone, kent. for collaberation and discussion for artists, designers, makers, hackers, programmers, tinkerer, professionals and hobbyists.')
|
||||||
|
web.template.append('<link rel="icon" type="image/png" href="/static/template/images/icon.png">')
|
||||||
|
|
||||||
|
#paths
|
||||||
|
web.document_root = os.path.abspath('./')
|
||||||
|
web.template.domain = 'http://maidstone-hackspace.org.uk/'
|
||||||
|
web.template.theme_full_path = os.path.abspath('./static/template') + os.sep
|
||||||
|
domain = 'http://192.168.21.41:5000/'
|
||||||
|
image_path = domain + os.sep + 'template' + os.sep + 'images' + os.sep
|
||||||
|
|
||||||
|
web.template.css_includes.append('/static/template/default.css')
|
||||||
|
web.template.css_includes.append('/static/template/js/jquery-ui/themes/base/jquery-ui.css')
|
||||||
|
|
||||||
|
|
||||||
|
def header():
|
||||||
|
# logo and social links at very top of the page
|
||||||
|
web.header_strip.create({})
|
||||||
|
web.header_strip.social(web.google_plus.create(web.template.domain, plus=True, share=False, comments=False).render())
|
||||||
|
web.template.body.append(web.header_strip.render())
|
||||||
|
|
||||||
|
# navigation
|
||||||
|
web.menu.create('/', 'leftNav')
|
||||||
|
web.menu * site.page_menu
|
||||||
|
web.template.body.append(web.menu.render())
|
||||||
|
|
||||||
|
# extra javascript libraries
|
||||||
|
web.template.javascript_includes.append('<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>')
|
||||||
|
web.template.javascript_includes.append('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>')
|
||||||
|
web.template.javascript_includes.append('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script>')
|
||||||
|
web.template.header.append('<link rel="icon" type="image/png" href="/static/images/favicon.png">')
|
||||||
|
|
||||||
|
def footer():
|
||||||
|
web.footer_content.create().append(
|
||||||
|
web.google_groups_signup.create(' and make yourself known','maidstone-hackspace').set_id('mailing-list-signup').render())
|
||||||
|
web.template.body.append(web.footer_content.render())
|
||||||
|
web.google_analytics.create('maidstone-hackspace.org.uk', 'UA-63373181-1')
|
||||||
|
web.template.body.append(web.google_analytics.render())
|
||||||
|
return web.render()
|
|
@ -0,0 +1,32 @@
|
||||||
|
import constants as site
|
||||||
|
|
||||||
|
from libs.rss_fetcher import feed_reader
|
||||||
|
|
||||||
|
from pages import web
|
||||||
|
from pages import header, footer
|
||||||
|
|
||||||
|
def index():
|
||||||
|
header()
|
||||||
|
web.page.create('blogs')
|
||||||
|
|
||||||
|
web.columns.create()
|
||||||
|
web.columns.append('test1')
|
||||||
|
web.columns.append('test2')
|
||||||
|
web.page.section(web.columns.render())
|
||||||
|
|
||||||
|
web.tiles.create()
|
||||||
|
feed = feed_reader(site.rss_feeds)
|
||||||
|
for row in feed:
|
||||||
|
print row.get('image')
|
||||||
|
web.tiles.append(
|
||||||
|
title = row.get('title'),
|
||||||
|
author = row.get('author'),
|
||||||
|
link = row.get('url'),
|
||||||
|
image = row.get('image'),
|
||||||
|
date = row.get('date'),
|
||||||
|
description = row.get('description'))
|
||||||
|
web.div.append(row)
|
||||||
|
web.page.section(web.tiles.render())
|
||||||
|
|
||||||
|
web.template.body.append(web.page.render())
|
||||||
|
return footer()
|
|
@ -0,0 +1,12 @@
|
||||||
|
import constants as site
|
||||||
|
|
||||||
|
from libs.rss_fetcher import feed_reader
|
||||||
|
|
||||||
|
from pages import web
|
||||||
|
from pages import header, footer
|
||||||
|
|
||||||
|
|
||||||
|
def index():
|
||||||
|
header()
|
||||||
|
|
||||||
|
return footer()
|
After Width: | Height: | Size: 309 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |