Commit 3c8e54df authored by Madi Baig's avatar Madi Baig
Browse files

Add panopto_example button

parent 0616ca42
Pipeline #213313 failed with stages
in 4 minutes and 45 seconds
......@@ -2,6 +2,7 @@ from flask import Blueprint, render_template, request, redirect
from imperial_panopto import panopto_login_required
from config import url_for2
from config.config import ENV, APP_NAME
from database.db import db
from models.entity import Entity
from imperial_ldap.auth import login_required, get_user_from_session
......@@ -13,7 +14,7 @@ home_blueprint = Blueprint('home', __name__, url_prefix='/')
@home_blueprint.route('')
def index():
user = get_user_from_session() # If there is no user logged, this returns None
return render_template('index.html', user=user)
return render_template('index.html', user=user, dev=ENV, appname=APP_NAME)
@home_blueprint.route('/dashboard')
......@@ -21,14 +22,14 @@ def index():
@using_materials # Indicate that we want to access the Materials API
def dashboard(materials_client, user):
my_courses = materials_client.get_courses_for_year("2122")
return render_template('dashboard.html', user=user, my_courses=my_courses)
return render_template('dashboard.html', user=user, my_courses=my_courses, dev=ENV, appname=APP_NAME)
@home_blueprint.route('/panopto_example')
@panopto_login_required
def panopto_example(panopto_client):
video = panopto_client.get_partially_viewed_videos()[0]
return render_template('panopto_example.html', video=video, iframe=panopto_client.get_iframe_of_video(video.id))
return render_template('panopto_example.html', video=video, iframe=panopto_client.get_iframe_of_video(video.id), dev=ENV, appname=APP_NAME)
@home_blueprint.route('/entities', methods=['GET', 'POST'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment