Skip to content

Commit

Permalink
Merge branch 'release/v1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottyates committed Mar 7, 2017
2 parents 580863a + 68bc81d commit 12dab87
Show file tree
Hide file tree
Showing 28 changed files with 227 additions and 263 deletions.
22 changes: 10 additions & 12 deletions canvas_manage_course/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
boto==2.40.0
boto3==1.3.1
Django==1.8.13
django-angular==0.7.16
boto3==1.4.4
Django==1.9.12
django-cached-authentication-middleware==0.2.1
django-redis-cache==1.6.5
django-redis-cache==1.7.1
hiredis==0.2.0
kitchen==1.2.1
ndg-httpsclient==0.4.0
kitchen==1.2.4
ndg-httpsclient==0.4.2
redis==2.10.5
psycopg2==2.6.1
requests==2.9.1
psycopg2==2.6.2
requests==2.13.0

git+ssh://[email protected]/penzance/[email protected]#egg=canvas-python-sdk==0.8.4
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-auth-lti==1.2.5
git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-common.git@v1.15.1#egg=django-icommons-common[async]==1.15.1
git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-ui.git@v1.2.1#egg=django-icommons-ui==1.2.1
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-canvas-lti-school-permissions==0.5
git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-common.git@v1.18.1#egg=django-icommons-common[async]==1.18.1
git+ssh://[email protected]/Harvard-University-iCommons/django-icommons-ui.git@v1.3.1#egg=django-icommons-ui==1.3.1
git+ssh://[email protected]/Harvard-University-iCommons/[email protected].1#egg=django-canvas-lti-school-permissions==0.5.1
16 changes: 4 additions & 12 deletions canvas_manage_course/requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@

# below are requirements specific to the local environment

ddt==1.0.1
ddt==1.1.1
django-debug-toolbar==1.5
django-sslserver==0.19
flake8==2.5.4
mock==2.0.0
oauthlib==1.1.1
pep8==1.7.0
pyvirtualdisplay==0.2
requests-oauthlib==0.6.1
pyvirtualdisplay==0.2.1
requests-oauthlib==0.8.0
selenium==2.53.2
xlrd==0.9.4

# icommons_common unit tests depend on ccsw, and ccsw depends on icommons_common.
# until ccsw gets its own proper project, and we move the delete command out of
# icommons_common and into ccsw, work around the circular dependency by calling
# out the ccsw dependency here.
git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=django-canvas-course-site-wizard==1.3.8
xlrd==1.0.0

git+ssh://[email protected]/Harvard-University-iCommons/[email protected]#egg=selenium-common==1.4.3
3 changes: 1 addition & 2 deletions canvas_manage_course/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
'django.contrib.staticfiles',
'django_auth_lti',
'django_rq',
'djangular',
'icommons_common',
'icommons_common.monitor',
'icommons_ui',
Expand All @@ -61,7 +60,6 @@
"from INSTALLED_APPS.", DeprecationWarning)

MIDDLEWARE_CLASSES = (
'djangular.middleware.DjangularUrlMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'cached_auth.Middleware',
Expand Down Expand Up @@ -102,6 +100,7 @@
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASE_APPS_MAPPING = {
'async': 'default',
'auth': 'default',
'contenttypes': 'default',
'icommons_common': 'termtool',
Expand Down
3 changes: 0 additions & 3 deletions canvas_manage_course/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

# For Django Debug Toolbar:
INTERNAL_IPS = ('127.0.0.1', '10.0.2.2',)
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}

# Log to console instead of a file when running locally
LOGGING['handlers']['default'] = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* tag types */

a {
.lti a {
text-decoration: none;
}
a:focus {
.lti a:focus {
text-decoration: none;
}
a:hover {
.lti a:hover {
text-decoration: none;
}
h1 {
Expand Down Expand Up @@ -40,7 +40,6 @@ p {
background: #fff;
cursor: pointer;
display: inline-block;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
margin: 0 36px 36px 0;
vertical-align: top;
width: 262px;
Expand Down
40 changes: 19 additions & 21 deletions canvas_manage_course/templates/canvas_manage_course/base.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
{% extends 'icommons_ui/base_lti.html' %}

{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Manage Course</title>
{% block head_meta %}
{{ block.super }}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{% endblock head_meta %}

{% block title %}Manage Course{% endblock title %}

<link href="{% static 'bootstrap-3.3.6/dist/css/bootstrap.min.css' %}" rel="stylesheet">
<link href="{% static 'font-awesome-4.5.0/css/font-awesome.min.css' %}" rel="stylesheet">
{% block stylesheets %}{% endblock stylesheets %}
</head>
<body>
<div class="container">
{% block breadcrumb %}{% endblock breadcrumb %}
{% block content %}{% endblock content %}
</div>
{% block stylesheet %}
{{ block.super }}
<link href="{% static 'font-awesome-4.5.0/css/font-awesome.min.css' %}" rel="stylesheet">
{% endblock stylesheet %}

<script src="{% static 'jquery-1.12.0/jquery-1.12.0.min.js' %}"></script>
<script src="{% static 'bootstrap-3.3.6/dist/js/bootstrap.min.js' %}"></script>
{% block javascript %}{% endblock javascript %}
</body>
</html>
{% block content %}
<div class="container">
{% block dashboard_breadcrumb %}{% endblock dashboard_breadcrumb %}
{% block tool_content %}{% endblock tool_content %}
</div>
{% endblock content %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@

{% load static %}

{% block stylesheets %}
{% block stylesheet %}
{{ block.super }}
<link href="{% static 'canvas_manage_course/css/dashboard.css' %}"
rel="stylesheet"/>
{% if no_tools_allowed %}
<link rel="stylesheet" type="text/css" media="screen"
href="{% static "lti-css/errors.css" %}" />
{% endif %}
{% endblock stylesheets %}
{% endblock stylesheet %}

{% block breadcrumb %}
{% block dashboard_breadcrumb %}
<nav>
<h3>
Manage Course
</h3>
</nav>
{% endblock %}
{% endblock dashboard_breadcrumb %}

{% block content %}
{% block tool_content %}
<main>
{% if no_tools_allowed %}
{% include 'icommons_ui/_custom_error.html' %}
Expand Down Expand Up @@ -138,4 +139,4 @@ <h2 class="card-content-title ellipsis" title="Manage Sections">
{% endif %}
</main>

{% endblock content %}
{% endblock tool_content %}
9 changes: 6 additions & 3 deletions canvas_manage_course/tests/test_lti_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def test_lti_launch(self, mock_get_previous_isites):

# try following the redirect, we should get a 200
session.auth = None
response2 = session.get(response.headers['location'])
url = self.live_server_url + response.headers['location']
response2 = session.get(url)
mock_get_previous_isites.assert_called_with(
self.params['lis_course_offering_sourcedid'])
self.assertEqual(response2.status_code, requests.codes.ok)
Expand Down Expand Up @@ -91,11 +92,13 @@ def test_multiple_lti_launch(self, mock_get_previous_isites):

# follow the "tab 2" redirect and verify 200
session.auth = None
response3 = session.get(response2.headers['location'])
url = self.live_server_url + response2.headers['location']
response3 = session.get(url)
mock_get_previous_isites.assert_called_with(
self.params['lis_course_offering_sourcedid'])
self.assertEqual(response3.status_code, requests.codes.ok)

# follow the "tab 1" redirect and verify 200
response4 = session.get(response1.headers['location'])
url = self.live_server_url + response1.headers['location']
response4 = session.get(url)
self.assertEqual(response3.status_code, requests.codes.ok)
4 changes: 1 addition & 3 deletions canvas_manage_course/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from django.conf.urls import include, url

from icommons_ui import views as icommons_ui_views

from canvas_manage_course import views

from icommons_ui import views as icommons_ui_views

urlpatterns = [
url(r'^course_dashboard$', views.dashboard_course, name='dashboard_course'),
Expand Down
13 changes: 7 additions & 6 deletions class_roster/templates/class_roster/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@

{% load static %}

{% block stylesheets %}
{% block stylesheet %}
{{ block.super }}
<link href="{% static 'canvas_manage_course/css/dashboard.css' %}"
rel="stylesheet"/>
<link href="{% static 'class_roster/css/class_roster.css' %}"
rel="stylesheet"/>
{% endblock stylesheets %}
{% endblock stylesheet %}


{% block breadcrumb %}
{% block dashboard_breadcrumb %}
<nav>
<h1>
<a href="{% url 'dashboard_course' %}">Manage Course</a>&nbsp;
<small><i class="fa fa-chevron-right"></i></small>&nbsp;Class Roster
</h1>
</nav>
{% endblock %}
{% endblock dashboard_breadcrumb %}


{% block content %}
{% block tool_content %}
<main>
<div id="content" role="main">
{% if num_of_courses > 0 %}
Expand All @@ -41,4 +42,4 @@ <h1>
{% endif %}
</div>
</main>
{% endblock content %}
{% endblock tool_content %}
9 changes: 5 additions & 4 deletions class_roster/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.conf.urls import patterns, url
from django.conf.urls import url

from class_roster import views

urlpatterns = patterns('',
url(r'^index$', 'class_roster.views.index', name='index'),
)
urlpatterns = [
url(r'^index$', views.index, name='index'),
]
7 changes: 4 additions & 3 deletions class_roster/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ def _get_roster_url(course_instance, user_id):
course_instance.get('term', {}).get('term_code', '')).strip()
if calendar_year == '' or cs_class_number == '' or term_code == '':
logger.error('Class roster tool cannot build a my.harvard class roster'
' link for course instance {}, as it is missing required '
' link for course instance {}, as it is missing required'
' information: calendar_year={}; cs_class_number={};'
' term_code={}', course_instance, calendar_year,
cs_class_number, term_code)
' term_code={}'.format(
course_instance.get('course_instance_id', '(unknown)'),
calendar_year, cs_class_number, term_code))
return None # we cannot build a link for this course instance; skip it

cs_term_code = '{}{}{}'.format(calendar_year[0], # [y]yyy
Expand Down
17 changes: 6 additions & 11 deletions isites_migration/management/commands/export_slide_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ def __init__(self, *args, **kwargs):

def add_arguments(self, parser):
parser.add_argument('keyword', help='the iSites keyword containing the slide tool to export')
parser.add_argument('-t', '--tool_id', default=settings.SLIDE_TOOL_ID,
help='the iSites slide tool tool_id to use; '
'default is {} (from settings)'
.format(settings.SLIDE_TOOL_ID))

def handle(self, *args, **options):
keyword = options['keyword']
tool_id = options['tool_id']

logger.info("Beginning export_slide_tool for keyword %s to S3 bucket %s", keyword, self.s3_bucket)
try:
Expand All @@ -42,17 +47,7 @@ def handle(self, *args, **options):
boto_session = boto3.session.Session(profile_name=settings.AWS_PROFILE)
s3 = boto_session.resource('s3')

topic_sql_query = """
SELECT t.topic_id AS topic_id, t.title AS title
FROM topic t, page_content pc, page p, site s
WHERE
s.keyword = '%s' AND
p.site_id = s.site_id AND
pc.page_id = p.page_id AND
t.topic_id = pc.topic_id AND
t.tool_id = %s
"""
topics = Topic.objects.raw(topic_sql_query, [keyword, settings.SLIDE_TOOL_ID])
topics = Topic.objects.filter(site__keyword=keyword, tool_id=tool_id)
for topic in topics:
logger.info("Exporting files for topic %d %s", topic.topic_id, topic.title)
topic_data = {
Expand Down
14 changes: 8 additions & 6 deletions isites_migration/templates/isites_migration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{% load django_helpers %}
{% load tz %}

{% block stylesheets %}
{% block stylesheet %}
{{ block.super }}
<style>
.content form {
text-align: center;
Expand All @@ -16,18 +17,18 @@
text-decoration: underline;
}
</style>
{% endblock stylesheets %}
{% endblock stylesheet %}

{% block breadcrumb %}
{% block dashboard_breadcrumb %}
<nav>
<h3>
<a href="{% url 'dashboard_course' %}">Manage Course</a>&nbsp;<small><i class="fa fa-chevron-right"></i></small>
Import iSites Content
</h3>
</nav>
{% endblock %}
{% endblock dashboard_breadcrumb%}

{% block content %}
{% block tool_content %}

<main>
<div class="content">
Expand Down Expand Up @@ -116,9 +117,10 @@ <h3 class="">Imported iSite(s)</h3>
{% endif %}
</div>
</main>
{% endblock content %}
{% endblock tool_content %}

{% block javascript %}
{{ block.super }}
<script>
$(document).ready(function(){

Expand Down
Loading

0 comments on commit 12dab87

Please sign in to comment.