Added Ilya's blog and other recent tweaks

This commit is contained in:
Oliver Marks 2016-01-13 21:13:10 +00:00
parent ff7a9a2337
commit 00b1194bb3
9 changed files with 54 additions and 30 deletions

View File

@ -1,7 +1,6 @@
page_menu = [
('Home', '/'),
#('Competition', '/competition'),
('Chat', '/chat'),
('Donate', '/donate'),
('Contact', '#mailing-list-signup')]
@ -29,14 +28,27 @@ tile_images = [
#required (author,url)
#optional (tags, image)
rss_feeds = [
{'author':'Simon Ridley',
'url': 'http://waistcoatforensicator.blogspot.com/feeds/posts/default?alt=rss'},
{'author':'Mathew Beddow', 'tags': ['tech'], 'url': 'http://www.matthewbeddow.co.uk/?feed=rss2'},
{'author':'Oliver Marks', 'url': 'http://www.digitaloctave.co.uk/rss.xml'},
{'author':'Mike McRoberts', 'url': 'http://thearduinoguy.org/?feed=rss2'}]
rss_feeds = [{
'author':'Simon Ridley',
'url': 'http://waistcoatforensicator.blogspot.com/feeds/posts/default?alt=rss'
}, {
'author':'Mathew Beddow', 'tags': ['tech'],
'url': 'http://www.matthewbeddow.co.uk/?feed=rss2'
}, {
'author':'Oliver Marks',
'url': 'http://www.digitaloctave.co.uk/rss.xml'
}, {
'author':'Ilya Titov',
'url': 'http://webboggles.com/feed/'
}, {
'author':'Mike McRoberts',
'url': 'http://thearduinoguy.org/?feed=rss2'
}]
kent_hackspace = ['http://www.medwaymakers.co.uk/', 'http://canterbury.hackspace.org.uk/']
kent_hackspace = [
'http://www.medwaymakers.co.uk/',
'http://canterbury.hackspace.org.uk/'
]
email = 'support@maidstone-hackspace.org.uk'

View File

@ -8,24 +8,20 @@ from scaffold.core.data.sql import query_builder
query_builder.query_path = os.path.abspath('./data/sql/')
class get_pledge(select_data):
debug = True
table = 'pledges'
columns = {'name', 'total'}
columns = {'id', 'name', 'total'}
required = {'name'}
class get_pledges(select_data):
debug = True
#~ table = 'pledges'
query_file = 'pledge_totals.sql'
#~ required = {'expired'}
columns_where = {'expired'}
required = {'environment'}
columns_where = {'expired', 'environment'}
grouping = {'name'}
class add_pledge(insert_data):
debug = True
table = 'pledges'

View File

@ -1,6 +1,6 @@
import constants as site
from libs.rss_fetcher import feed_reader
from scaffold.readers.rss_reader import feed_reader
from pages import web
from pages import header, footer

View File

@ -6,9 +6,9 @@ def index():
header('Maidstone Hackspace Calendar')
web.template.body.append(web.header_strip.create({}).render())
web.template.body.append(web.menu.render())
web.calendar.create('https://www.google.com/calendar/feeds/0rtjmmdbsb8e9351mkip02g8n8%40group.calendar.google.com/public/basic')
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 and will respond when they get a chance.').render())
web.page.section(web.chat.create('maidstone-hackspace').render())

View File

@ -3,6 +3,7 @@ from flask import request
from flask import redirect, abort
from scaffold import web
from scaffold.core.validate import validate
from pages import header, footer
from data import donate
@ -22,7 +23,7 @@ def index():
We may run pledges in the future for equipment in which case use the reference for the equipment your pledging towards.""")
web.page.section(web.paragraph.render())
for item in donate.get_pledges():
for item in donate.get_pledges({'environment':int(gocardless_environment=='production')}):
web.paragraph.create(
"""Currently raised £%.2f towards %s target is £%.2f.""" % (
item.get('total', 0) if item.get('total', 0) else 0.0,
@ -42,21 +43,25 @@ def index():
@donate_pages.route("/donate/populate", methods=['GET'])
def populate_by_name():
pledge = donate.get_pledge({'name': '#lair'}).get()
print pledge
import gocardless
gocardless.environment = gocardless_environment
gocardless.set_details(**gocardless_credentials)
merchant = gocardless.client.merchant()
for bill in merchant.bills():
environment = int(gocardless_environment=='production')
donate.add_payment().execute({'pledge_id':pledge.get('id','') , 'reference': bill.id, 'amount': bill.amount_minus_fees, 'environment': environment})
return abort()
donate.add_payment().execute({'pledge_id': pledge.get('id') , 'reference': bill.id, 'amount': bill.amount_minus_fees, 'environment': environment})
return abort(404)
@donate_pages.route("/donate/submit", methods=['POST'])
def submit_donation():
#~ if request.form.get('amount'):
#~ return index()
import gocardless
gocardless.environment = gocardless_environment
print app_domain
gocardless.set_details(**gocardless_credentials)
url = gocardless.client.new_bill_url(
request.form.get('amount'),
@ -100,7 +105,7 @@ def success_donation():
print bill.status
print bill.user
environment = int(gocardless_environment=='production')
donate.add_payment().execute({'pledge_id':pledge.get('name','') , 'reference': bill_id, 'amount': bill.amount_minus_fees, 'environment': environment})
donate.add_payment().execute({'pledge_id':pledge.get('id','') , 'reference': bill_id, 'amount': bill.amount_minus_fees, 'environment': environment})
web.template.create('Maidstone Hackspace')

View File

@ -38,9 +38,17 @@ def profile(user_id, user_name):
web.images.create(user.get('profile_image', '/static/images/hackspace.png'), name).add_attributes('width', '200').render()
)
web.paragraph.add(name)
web.paragraph.add('%s' % (user.get('email')))
#~ web.paragraph.add('%s' % (user.get('email')))
web.paragraph.add('Last Login %s' % (user.get('last_login', '')))
web.paragraph.add('Member since %s' % (user.get('created', '')))
web.list.create('badges', 'ul')
web.list.append(web.images.create('/static/images/badges/member.png').render())
web.list.append(web.images.create('/static/images/badges/member.png').render())
web.list.append(web.images.create('/static/images/badges/member.png').render())
web.paragraph.add(web.list.render())
web.page.section(web.paragraph.render())
web.template.body.append(web.page.render())

View File

@ -6,7 +6,7 @@ li p {margin: 20px 0px 0px 30px;height:45px;}
fieldset {margin:20px;}
fieldset p {margin: 20px 0px 0px 0px;height:45px;}
label {color:#fff;text-align:left;}
input {line-height:45px;float:right;margin:0px;color:#000;padding-left:10px;}
input {line-height:40px;float:right;margin:0px;color:#000;padding-left:10px;}
select {float:right;margin:0px;color:#000;padding:10px;}
p {margin:25px;line-height:150%;}
h2 {margin-left:25px;color:#fff;}
@ -15,7 +15,7 @@ li {padding-bottom:10px;line-height:150%;}
/*
input {margin:0px;margin-bottom:20px;padding:10px;}
*/
button {margin-top:20px;background-color: #fff; height: 48px; width:100%; border-radius: 3px;box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.2);
button {background-color: #fff; height: 48px; width:100%; border-radius: 3px;box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.2);
border:1px solid #000a0d; -webkit-border-radius: 3px; -moz-border-radius: 3px;border-radius: 3px;
font-size:12px;font-family:arial, helvetica, sans-serif; font-weight:bold;
padding: 10px 10px 10px 10px;
@ -33,8 +33,7 @@ button {margin-top:20px;background-color: #fff; height: 48px; width:100%; border
.left {float:left;}
.right {float:right;}
.bottom {position:absolute;bottom:0px;}
.full_width {left:0px;right:0px;}
.hide {display:none;}
#ajaxPopup {position:absolute;width:750px;height:550px;background-color:#fff;top:68px;left:50%;margin-left: -375px;box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.2);background-color:#93B1C6;}
@ -44,7 +43,8 @@ button {margin-top:20px;background-color: #fff; height: 48px; width:100%; border
#ajaxPopup p {margin:20px;}
#ajaxPopup input {width:50%;}
#ajaxPopup button {position:absolute;bottom:0px;}
#ajaxPopup .bottom {position:absolute;bottom:0px;}
#ajaxPopup .full_width {left:0px;right:0px;}
.margin_default {margin:10px;}
@ -244,6 +244,9 @@ height:48px;width:48px; -webkit-animation:spin 2s linear infinite ;-moz-animatio
#membercard .container {position:relative;top:50%; width:100%;}
#membercard .middle {position:absolute;top:-60px;width:100%;}
#membercard label {color:#000;text-align:left;line-height:48px;}
#membercard input {width:140px;}
#membercard .button {margin:0px;}
#membercard button {margin-top:20px;}
#membercard legend {margin-top:10px;margin-bottom:10px;font-weight:strong;}
#membercard fieldset {position:absolute;top:0px;left:0px;right:0px;padding:0px;margin:28px;border:0px;}

0
site/static/images/oauth/google.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -17,7 +17,7 @@ class control(base_widget_extended):
<p>MHS%s</p><p>%s</p>
</div>
</div>''' % (self.reference, self.name)
content='<form action="/profile/membership" method="post"><fieldset><legend>Join Maidstone Hackspace</legend><p><label for="amount">Subscription Amount<input name="amount" placeholder="20.00" value="20.00" type="text"></label></p><button type="submit">submit</button></fieldset></form>'
content='<form action="/profile/membership" method="post"><fieldset><legend>Join Maidstone Hackspace</legend><p><label for="amount">Subscription Amount<input name="amount" placeholder="20.00" value="20.00" type="text"></label></p><p class="button"><button type="submit">submit</button></p></fieldset></form>'
return '''
<div id="membercard">
%s