minmal working example
This commit is contained in:
10
app.py
10
app.py
@@ -28,14 +28,14 @@ def index():
|
|||||||
|
|
||||||
events = calendar_interface.get_all_calendar_events()
|
events = calendar_interface.get_all_calendar_events()
|
||||||
|
|
||||||
if post is None:
|
if events is None:
|
||||||
abort(404)
|
abort(404)
|
||||||
else:
|
else:
|
||||||
return render_template('index.html', events=events)
|
return render_template('index.html', events=events)
|
||||||
|
|
||||||
@app.route('/<int:event_id>')
|
# @app.route('/<int:event_id>')
|
||||||
def post(post_id):
|
# def post(post_id):
|
||||||
post = get_post(post_id)
|
# post = get_post(post_id)
|
||||||
return render_template('show_event.html', post=post)
|
# return render_template('show_event.html', post=post)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import json
|
import json
|
||||||
from lib2to3.pgen2.tokenize import TokenError
|
from lib2to3.pgen2.tokenize import TokenError
|
||||||
import logging
|
import logging
|
||||||
|
import argparse
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import msal
|
import msal
|
||||||
@@ -80,3 +81,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
print("Available calendars are:")
|
print("Available calendars are:")
|
||||||
print(json.dumps(cal_name_id, indent=2))
|
print(json.dumps(cal_name_id, indent=2))
|
||||||
|
print(json.dumps(list(get_all_calendar_events()[0].keys()), indent=2))
|
||||||
|
|||||||
48
readme.md
Normal file
48
readme.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Available calendar attributes are:
|
||||||
|
|
||||||
|
[
|
||||||
|
"@odata.etag",
|
||||||
|
"id",
|
||||||
|
"createdDateTime",
|
||||||
|
"lastModifiedDateTime",
|
||||||
|
"changeKey",
|
||||||
|
"categories",
|
||||||
|
"transactionId",
|
||||||
|
"originalStartTimeZone",
|
||||||
|
"originalEndTimeZone",
|
||||||
|
"iCalUId",
|
||||||
|
"reminderMinutesBeforeStart",
|
||||||
|
"isReminderOn",
|
||||||
|
"hasAttachments",
|
||||||
|
"subject",
|
||||||
|
"bodyPreview",
|
||||||
|
"importance",
|
||||||
|
"sensitivity",
|
||||||
|
"isAllDay",
|
||||||
|
"isCancelled",
|
||||||
|
"isOrganizer",
|
||||||
|
"responseRequested",
|
||||||
|
"seriesMasterId",
|
||||||
|
"showAs",
|
||||||
|
"type",
|
||||||
|
"webLink",
|
||||||
|
"onlineMeetingUrl",
|
||||||
|
"isOnlineMeeting",
|
||||||
|
"onlineMeetingProvider",
|
||||||
|
"allowNewTimeProposals",
|
||||||
|
"occurrenceId",
|
||||||
|
"isDraft",
|
||||||
|
"hideAttendees",
|
||||||
|
"responseStatus",
|
||||||
|
"body",
|
||||||
|
"start",
|
||||||
|
"end",
|
||||||
|
"location",
|
||||||
|
"locations",
|
||||||
|
"recurrence",
|
||||||
|
"attendees",
|
||||||
|
"organizer",
|
||||||
|
"onlineMeeting",
|
||||||
|
"calendar@odata.associationLink",
|
||||||
|
"calendar@odata.navigationLink"
|
||||||
|
]
|
||||||
@@ -21,18 +21,9 @@
|
|||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="#">About</a>
|
<a class="nav-link" href="#">About</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="{{url_for('create')}}">New Post</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="container">
|
|
||||||
{% for message in get_flashed_messages() %}
|
|
||||||
<div class="alert alert-danger">{{ message }}</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% block content %} {% endblock %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Optional JavaScript -->
|
<!-- Optional JavaScript -->
|
||||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
<!-- {% extends 'base.html' %} -->
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% block title %} Welcome to FlaskBlog {% endblock %}</h1>
|
<h1>{% block title %} Welcome {% endblock %}</h1>
|
||||||
{% for post in posts %}
|
{% for event in events %}
|
||||||
<a href="{{ url_for('post', post_id=post['id']) }}">
|
<a>
|
||||||
<h2>{{ post['title'] }}</h2>
|
<h2>{{ event['subject'] }}</h2>
|
||||||
</a>
|
</a>
|
||||||
<span class="badge badge-primary">{{ post['created'] }}</span>
|
<span class="badge badge-primary">{{ event["subject"] }}</span>
|
||||||
|
|
||||||
<a href="{{ url_for('edit', id=post['id']) }}">
|
<a>
|
||||||
<span class="badge badge-warning">Edit</span>
|
<span class="badge badge-warning">Edit</span>
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<h2>{% block title %} {{ post['title'] }} {% endblock %}</h2>
|
|
||||||
<span class="badge badge-primary">{{ post['created'] }}</span>
|
|
||||||
<p>{{ post['content'] }}</p>
|
|
||||||
{% endblock %}
|
|
||||||
Reference in New Issue
Block a user