added social links

This commit is contained in:
Oliver Marks 2015-07-03 07:23:16 +01:00
parent 15b81ec9f4
commit cd01c72140
13 changed files with 183 additions and 137 deletions

View File

@ -1,8 +1,8 @@
page_menu = [
('Home', '/'),
#('About', '#about'),
('Competition', '/competition'),
('Chat', '/chat'),
('Contact', '#mailing-list-signup')]
banner_images = [

View File

@ -3,6 +3,9 @@ import sys
import codecs
import argparse
sys.path.append(os.path.abspath('../../../scaffold/'))
sys.path.insert(0,os.path.abspath('../../../scaffold/'))
from scaffold.web import web as html
from scaffold.web import www

File diff suppressed because one or more lines are too long

View File

@ -2,47 +2,46 @@
<!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="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-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>
<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" />
<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>
<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 - Screw sorting competition</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript" src="/static/js/jquery/jquery.min.js"></script>
</head>
<body>
<div id="headerstrip"><nav class="navstrip"><div class="left mini-logo">Maidstone Hackspace</div><div class="social"><div class="btn"><a href="https://twitter.com/share" class="twitter-share-button" data-via="MHackspace">Tweet</a></div><div class="btn"><script type="IN/Share" data-url="http://maidstone-hackspace.org.uk/" data-counter="right"></script></div><div class="btn"><div size="standard" class="g-plusone" data-href="http://maidstone-hackspace.org.uk/" data-size="medium" data-annotation="bubble" count="true"></div></div></div></nav></div>
<nav id="leftNav" class="menu" ><ul><li class="active mi0"><a href="/" >Home</a></li><li class="mi1"><a href="/competition" >Competition</a></li><li class="mi2"><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>Welcome to the first Maidstone Hackspace challenge! A great opportunity for all to show off their creative flair and to join our community of makers, tinkerers, artists and more.</p><h2>The Challenge:</h2></section><section class="pageSection"><p>Design a device which can sort a jar of screws by size, the winning entry will be built by Maidstone Hackspace.</p></section><section class="pageSection"><p>Concepts can be designed in any software as long as the finished product is viewable without any specialist software e.g.JPG images. If you prefer to paint or draw we accept that too.</p></section><section class="pageSection"><p>Submissions must be via our mailing list. The closing date is the 31st of July, submissions after this date will not be entered.</p></section><section class="pageSection"><p><a title="Submit your image here." href="https://groups.google.com/forum/#!forum/maidstone-hackspace" >Submit your image here.</a></p></section><section class="pageSection"><h2>Win a UNO Basic Starter Kit</h2></section><section class="pageSection"><p><img src="http://imgapp.banggood.com/thumb/large/2014/xiemeijuan/03/SKU208787/SKU208787a.jpg" alt="Arduino starter kit" align="middle" style="margin:auto;display:block;width:500px;" />This kit comes with an arduino board and various sensors and components, list below of every thing in the kit.<ul class="bullet-list" >
<div id="headerstrip"><nav class="navstrip"><div class="left mini-logo">Maidstone Hackspace</div><div class="social"><div class="btn"><a href="https://twitter.com/share" class="twitter-share-button" data-via="MHackspace">Tweet</a></div><div class="btn"><div class="fb-share-button" data-href="http://maidstone-hackspace.org.uk/competition" data-layout="button_count"></div></div><div class="btn"><script type="IN/Share" data-url="http://maidstone-hackspace.org.uk/competition" data-counter="right"></script></div><div class="btn"><div size="standard" class="g-plusone" data-href="http://maidstone-hackspace.org.uk/competition" data-size="medium" data-annotation="bubble" count="true"></div></div></div></nav></div>
<nav id="leftNav" class="menu" >
<ul>
<li class="mi0"><a href="/" >Home</a></li>
<li class="active mi1"><a href="/competition" >Competition</a></li>
<li class="mi2"><a href="/chat" >Chat</a></li>
<li class="mi3"><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>Welcome to the first Maidstone Hackspace challenge! A great opportunity for all to show off their creative flair and to join our community of makers, tinkerers, artists and more.</p><h2>The Challenge:</h2></section>
<section class="pageSection">
<p>Design a device which can sort a jar of screws by size, the winning entry will be built by Maidstone Hackspace.</p></section>
<section class="pageSection">
<p>Concepts can be designed in any software as long as the finished product is viewable without any specialist software e.g.JPG images. If you prefer to paint or draw we accept that too.</p></section>
<section class="pageSection">
<p>Submissions must be via our mailing list. The closing date is the 31st of July, submissions after this date will not be entered.</p></section>
<section class="pageSection">
<p><a title="Submit your image here." href="https://groups.google.com/forum/#!forum/maidstone-hackspace" >Submit your image here.</a>
</p></section>
<section class="pageSection">
<h2>Win a UNO Basic Starter Kit</h2></section>
<section class="pageSection">
<p><img src="http://imgapp.banggood.com/thumb/large/2014/xiemeijuan/03/SKU208787/SKU208787a.jpg" alt="Arduino starter kit" align="middle" style="margin:auto;display:block;width:500px;" />
This kit comes with an arduino board and various sensors and components, list below of every thing in the kit.<ul class="bullet-list" >
<li>1 x Arduino UNO R3 development board</li>
<li>1 x USB cable</li>
<li>1 x Prototype extension board</li>
@ -80,28 +79,23 @@
<li>1 x 10K resistor plug</li>
<li>1 x 9V battery</li>
<li>1 x 2.54mm 40pin pin header</li>
</ul></p></section><footer class="pageFooter"></footer></div>
</ul></p></section>
<footer class="pageFooter">
</footer>
</div>
<div id="footer"><div id="footertop"></div><div id="footerbottom"><div class="container"><div class="copyright">&copy;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>
<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" />
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<link rel="stylesheet" id="navigationCss" href="/static/template/js/jquery-ui/themes/base/jquery-ui.css" media="" type="text/css" />
<script><!--//--><![CDATA[//><!--!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');
//]]></script>
<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" />
<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<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" ><!--//--><![CDATA[//><!--
<div id="fb-root"></div><script><!--//--><![CDATA[//><!--
//facebook share
(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));
//]]></script><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");

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,6 @@ from pages import chat
from pages import blog
from pages import competition
web_app = Flask(__name__, static_url_path='/static')
# local testing server, add your pages here

View File

@ -57,7 +57,10 @@ class feed_reader:
self.author = feed_info.get('author')
self.tags = feed_info.get('tags')
if feed_info.get('url').startswith('http:'):
response = requests.get(feed_info.get('url'), stream=True, timeout=timeout)
try:
response = requests.get(feed_info.get('url'), stream=True, timeout=timeout)
except requests.exceptions.Timeout as e:
continue
if response.headers.get('content-encoding') == 'gzip':
response.raw.read = functools.partial(response.raw.read, decode_content=True)
try:

View File

@ -1,4 +1,5 @@
import os
import sys
from libs.rss_fetcher import feed_reader
@ -8,6 +9,7 @@ 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">')
@ -19,29 +21,41 @@ 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')
with web.template as setup:
setup.persistent_header('<link rel="stylesheet" id="navigationCss" href="/static/template/default.css" media="" type="text/css" />')
setup.persistent_header('<link rel="stylesheet" id="navigationCss" href="/static/template/js/jquery-ui/themes/base/jquery-ui.css" media="" type="text/css" />')
setup.persistent_header('<script type="text/javascript" src="/static/js/jquery-2.1.4.min.js"></script>')
setup.persistent_header('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>')
setup.persistent_header('<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script>')
setup.persistent_header('<link rel="icon" type="image/png" href="/static/images/favicon.png">')
def header():
#~ <meta property="og:title" content="The Rock" />
#~ <meta property="og:type" content="video.movie" />
#~ <meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
#~ <meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
def header(title, description, url=''):
# 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.header_strip.social(web.like.create(url=web.template.domain, plus=True, linkedin=True, facebook=True, twitter='MHackspace').render())
web.header_strip.social(web.like.create(url=web.template.domain + url, plus=True, linkedin=True, facebook=True, twitter='MHackspace').render())
web.template.body.append(web.header_strip.render())
# navigation
web.menu.create('/', 'leftNav')
web.menu.create('/' + url, '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">')
#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(

View File

@ -7,11 +7,12 @@ from pages import header, footer
def index():
header()
web.template.body.append(web.header_strip.create({}).render())
web.template.body.append(web.menu.render())
web.template.create('Maidstone Hackspace - Chat room')
header('chat')
#web.template.body.append(web.header_strip.create({}).render())
#web.template.body.append(web.menu.render())
web.page.create(web.title.create('IRC Chat Room').render())
web.page.create(web.paragraph.create('Pop in and say hi, please be patient users tend to idle, but will like respond if given a chance.').render())
web.page.create(web.paragraph.create('Pop in and say hi, please be patient users tend to idle, but will likely respond given a chance.').render())
web.page.section(web.chat.create('maidstone-hackspace').render())
web.template.body.append(web.page.render())
return footer()

View File

@ -47,8 +47,9 @@ features = [
def index():
""" page for testing new components"""
header()
web.template.create(title="Maidstone Hackspace - Screw sorting competition")
header('competition')
web.page.create(
web.images.create(
image='/static/images/competitions/screw_sorting_competition_banner.jpg',
@ -60,7 +61,7 @@ def index():
web.paragraph.create(
"""Welcome to the first Maidstone Hackspace challenge! A great opportunity for all to show off their creative flair and to join our community of makers, tinkerers, artists and more.""")
web.page.section(web.paragraph.render())
web.page.append(web.title.create('The Challenge:').render())
web.paragraph.create(
"""Design a device which can sort a jar of screws by size, the winning entry will be built by Maidstone Hackspace.""").render()

View File

@ -7,11 +7,8 @@ from pages import header, footer
def index():
web.template.create('Maidstone Hackspace')
header()
web.template.body.append(web.header_strip.create({}).render())
web.template.body.append(web.menu.render())
web.page.create('')
web.page.section(
web.images.create(

View File

@ -136,5 +136,5 @@ button {margin-bottom:20px;background-color: #fff; height: 48px; width:100%; bor
.social-chat iframe{display:block;border:0px;width:100%;height:100%;}
.social {z-index:1;position:absolute;right:0px;top:0px;margin-top:25px;}
.social div{float:left;margin-left:20px;}
.social .btn{float:left;margin-left:20px;}
.col {width:480px;float:left;}

View File

@ -26,10 +26,11 @@ class control(base_widget):
if plus is not None:
if self.plus_script is False:
self.plus_script = True
if int(plus) > 0:
self.includes.append("""<script type="text/javascript" async="true" defer="defer" src="https://apis.google.com/js/platform.js?publisherid=%s"></script>""" % self.plus)
if int(plus) > 1:
self.footer.append("""<script type="text/javascript" async="true" defer="defer" src="https://apis.google.com/js/platform.js?publisherid=%s"></script>""" % self.plus)
else:
self.includes.append("""<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>""")
self.footer.append("""<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>""")
if twitter is not None:
if self.twitter_script is False:
self.twitter_script = True
@ -46,7 +47,7 @@ class control(base_widget):
if self.facebook_script is False:
self.facebook_script = True
self.footer.append("""
<div id="fb-root"></div><script><!--//--><![CDATA[//><!--(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));\n//]]></script>""")
<div id="fb-root"></div><script><!--//--><![CDATA[//><!--\n//facebook share\n(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));\n//]]></script>""")
return self
def render(self):
@ -55,7 +56,7 @@ class control(base_widget):
if self.twitter:
htm += '<div class="btn"><a href="https://twitter.com/share" class="twitter-share-button" data-via="%s">Tweet</a></div>' % self.twitter
if self.facebook:
htm += '<div class="btn"><div class="fb-share-button" data-href="%s" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div></div>' % self.url
htm += '<div class="btn"><div class="fb-share-button" data-href="%s" data-layout="button_count"></div></div>' % self.url
if self.linkedin:
htm += '<div class="btn"><script type="IN/Share" data-url="%s" data-counter="right"></script></div>' % self.url
if self.plus is True: