fix(examples): Small fixes for Send Availability plugin

This commit is contained in:
Drew Regitsky 2015-11-20 15:21:58 -08:00
parent abb6378bd5
commit 690dca50cb
8 changed files with 28 additions and 14 deletions

View file

@ -20,10 +20,6 @@ app = Flask(__name__)
m.init_db() m.init_db()
@app.route('/', methods=["GET", "POST"])
def hello_world():
return render_template("success.html")
@app.route('/register-events', methods=["POST"]) @app.route('/register-events', methods=["POST"])
def register_events(): def register_events():
@ -154,12 +150,12 @@ def _make_ics(event, etime):
evt.add('summary', event.title) evt.add('summary', event.title)
evt.add('location', event.location) evt.add('location', event.location)
evt.add('description', event.description) evt.add('description', event.description)
evt.add('dtstart', etime.start) evt.add('dtstart', etime.start.replace(tzinfo=pytz.UTC))
evt.add('dtend', etime.end) evt.add('dtend', etime.end.replace(tzinfo=pytz.UTC))
evt.add('dtstamp', datetime.now()) evt.add('dtstamp', datetime.now(pytz.UTC))
evt['uid'] = '{timestamp}/{email}'.format( evt['uid'] = '{timestamp}/{email}'.format(
timestamp=time.mktime(datetime.now().timetuple()), timestamp=time.mktime(datetime.now(pytz.UTC).timetuple()),
email=event.organizer.email email=event.organizer.email
) )
evt.add('priority', 5) evt.add('priority', 5)

File diff suppressed because one or more lines are too long

View file

@ -14,6 +14,7 @@
.content { .content {
font-size: 18px; font-size: 18px;
margin-top: 20px; margin-top: 20px;
color: #AAA;
} }
</style> </style>
</head> </head>

View file

@ -7,8 +7,8 @@
</style> </style>
</head> </head>
<body> <body>
<h1 class="title"><span style="color:#AAA">Invitation:</span> {{ event.title }}</h1> <h1 class="title">{{ event.title }}</h1>
<h3 class="location"><span style="color:#AAA">Location:</span> {{ event.location }}</h3> <h3 class="location">{{ event.location }}</h3>
<div class="description">{{ event.description }}</div> <div class="description">{{ event.description }}</div>
</body> </body>
</html> </html>

View file

@ -2,9 +2,10 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title></title> <title>Schedule: {{ event.title }}</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<script src='/static/js/moment.min.js'></script> <script src='/static/js/moment.min.js'></script>
<script src='/static/js/moment-timezone-with-data.min.js'></script>
<style> <style>
.selected { .selected {
background: #8CF; background: #8CF;
@ -45,7 +46,7 @@
return { return {
date: moment(e.start*1000).format("dddd, MMM Do"), date: moment(e.start*1000).format("dddd, MMM Do"),
time: moment(e.start*1000).format("h:mma") + "-" + time: moment(e.start*1000).format("h:mma") + "-" +
moment(e.end*1000).format("h:mma"), moment(e.end*1000).format("h:mma")+ " (" + moment().tz(moment.tz.guess()).format("z") + ")",
serverKey: e.key serverKey: e.key
}; };
}); });

View file

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title></title> <title>Event Scheduled</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<style> <style>
.icon { .icon {

View file

@ -6,6 +6,7 @@
<link rel='stylesheet' href='fullcalendar/fullcalendar.css' /> <link rel='stylesheet' href='fullcalendar/fullcalendar.css' />
<script src='nylas://N1-Send-Availability/fullcalendar/lib/jquery.min.js'></script> <script src='nylas://N1-Send-Availability/fullcalendar/lib/jquery.min.js'></script>
<script src='nylas://N1-Send-Availability/fullcalendar/lib/moment.min.js'></script> <script src='nylas://N1-Send-Availability/fullcalendar/lib/moment.min.js'></script>
<script src='nylas://N1-Send-Availability/fullcalendar/lib/moment-timezone-with-data.min.js'></script>
<script src='nylas://N1-Send-Availability/fullcalendar/fullcalendar.js'></script> <script src='nylas://N1-Send-Availability/fullcalendar/fullcalendar.js'></script>
<script> <script>
@ -146,7 +147,8 @@
start: e.start.unix(), start: e.start.unix(),
end: e.end.unix(), end: e.end.unix(),
date: e.start.format("dddd, MMM Do"), //event date, in local timezone date: e.start.format("dddd, MMM Do"), //event date, in local timezone
time: e.start.format("h:mma")+"-"+e.end.format("h:mma"), //event duration, in local time time: e.start.format("h:mma")+"-"+e.end.format("h:mma")+ //event duration, in local time
" ("+moment().tz(moment.tz.guess()).format("z")+")", //local time zone abbrev
serverKey: randomId(128) //string to access this time slot on the server serverKey: randomId(128) //string to access this time slot on the server
} }
}) })

File diff suppressed because one or more lines are too long