Add enrollment term to course autocomplete

Test Plan:
  * Search under Find a Course on any Managed Accounts page
  * Search for a course in Import Content (Copy a Canvas Course)

The autocomplete drop-down should show course name and its term.
Improve course autocomplete customization

* Update spec to test for enrollment term subtitle in autocomplete
* Detect presense of autocomplete before customizing _renderItem
Improve course autocomplete customization (Part 2)

Update content migrations Selenium spec to test for enrollment term
subtitle in autocomplete.
Initialize course autocomplete within the bundle

Remove the original autocomplete behavior, in favor of this more robust
approach of initializing everything in one place.
Add aria-label to course autocomplete
adds completed_at to course_progress API

fixes CNVS-12257

test plan:
* set up a course with modules, module items
** and module completion requirements
* on each module, check the box that says:
** "students must move through requirements in
**  this module in sequential order"
* enroll a user in the course
* with that user's ACCESS-TOKEN, perform:

curl -H "Authorization: Bearer <ACCESS-TOKEN>" \
         -X GET -F 'include[]=course_progress' \
         <canvas>/api/v1/courses

* verify there is a completed_at field in the
** course_progress response
* verify that the completed_at field is nil unless
** the user has completed all the completion_requirements
** for all the modules
* if the user has completed all the completion_requirements
** for all the moduels, the completed_at date should be the
** date associated with the last thing the user did to complete
** the course.
* for example, if the last item is submitting an assignment,
** the completed_at date should be the submission date of that
** assignment
* verify that courses with 0 completion_requirements return
** nil for completed_at date

Change-Id: I6dfd6c7ec4168317cdcac0be13de52e9111f8c13
Reviewed-on: https://gerrit.instructure.com/32983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
calendar2: limit context selection to 10 items

fixes CNVS-2221

test plan:
  * create more than ten courses
  * open calendar2
  * try to select more than ten contexts
  * verify that your selection is limited to ten items

Change-Id: I17c5f87a7929433613c2cb25bc7b89d858353fd2
Reviewed-on: https://gerrit.instructure.com/33266
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
use binmode for s3 download file

test plan:
 - you should be able to perform content imports on rails3
   (specifically, there should not be a "Content-length does not match",
    or, for very small imports, "(something) from ASCII-8BIT to UTF-8"
    error)

fixes CNVS-12229

Change-Id: I8a549c3760972dc028461b391c87a2fcc98ff9f4
Reviewed-on: https://gerrit.instructure.com/33186
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
export media comments from copied courses

test plan:
 - attach media comments to a course
 - copy the course
 - export the copy
 - import the package
 - the media comments should be preserved

fixes CNVS-12228

Change-Id: Ie200d65c77856ac0cd8a694c8cb4fb56558cf260
Reviewed-on: https://gerrit.instructure.com/32975
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Move time related code into canvas_time gem

fixes CNVS-10748

Change-Id: If9015c54bf54969d8c47e5e39a372e1c5bfe158b
Reviewed-on: https://gerrit.instructure.com/32532
Reviewed-by: Raphael Weiner <instructure@pivotallabs.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
refactor tests for Alert model

fixes CNVS-12353

test plan:
- no QA needed, only specs changed

Change-Id: Idb59de448446c07242f0150cf265d02efd8b7ff0
Reviewed-on: https://gerrit.instructure.com/33219
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
make the modules page responsive

fixes CNVS-12179

The modules page is now responsive for smaller screens. Allows people
to view view modules with proper truncation.

Test Plan

Senario: View the modules page from the homepage as a student

As a student
Given I my homepage is set to use the modules page
And I have module items with really long titles
When I go to the homepage
I should see that my module item titles have truncated titles
And when I resize my window to 970px there is a horizontal scroll bar
And the date and points do NOT disapear

Senario: View the modules page as a student

As a student
Given I have module items with really long titles
When I go to the modules page
I should see that my module item titles have truncated titles
And when I resize my window to 700px there is a horizontal scroll bar
And the date and points do NOT disapear

Senario: View the modules page from the homepage as a teacher

As a teacher
Given I my homepage is set to use the modules page
And I have module items with really long titles
When I go to the homepage
I should see that my module item titles have truncated titles
And when I resize my window to 970px there is a horizontal scroll bar
When I resize to 1000px the date column should disapear
And the points column should be visible

Senario: View the modules page as a student

As a teacher
Given I have module items with really long titles
When I go to the modules page
I should see that my module item titles have truncated titles
And when I resize my window to 700px there is a horizontal scroll bar
When I resize to 1000px the date column should disapear
And the points column should be visible

Senario: Should always show at least 300px of the title
As a teacher or student
When I view any modules page
The module item titles should always display at least 300px of the
title not matter what the screensize

Senario: Should always show at least 300px of the title
As a teacher or student
When I view any modules page
I should see that long module titles truncate
And the module title should have a hover over title attribute

Change-Id: I518b6ec2a3eae87474e781c0956e8740a905ec2a
Reviewed-on: https://gerrit.instructure.com/33204
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
fix module item indentation

fixes CNVS-12368

Indenting module items should all line up

Test Plan

As a teacher or student
Given I have a module item that is indented
And it has completion requirements

When I view the modules page or homepage with module items
Then the module item title should be indented
And the module item icon should be indented
And the module item descriptions should be indented

Change-Id: I9908befe3fdcc871693e6eaacdc1a2cf5791279b
Reviewed-on: https://gerrit.instructure.com/33244
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
srgb - catch failed csv flash error

fixes CNVS-11634

test plan
- in srgb
- click upload CSV
- don't select a file, click upload
- verify that screenreader, JAWS read the flash error

Change-Id: I1fb82fd094e8ee4bcfd4878dd714ba76873449ac
Reviewed-on: https://gerrit.instructure.com/32950
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
Add grade passback columns to assignments table

Test Plan:
- In console:
  - a = Assignment.new
  - a.integration_id = '12345'
  - a.post_to_sis = true
  - a.save
- it should save the two values

Fixes SIS-198

Change-Id: I9cd8e9a23db3357a8688d8cdb8b96727b8881e83
Reviewed-on: https://gerrit.instructure.com/32911
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Adams <eadams@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
fix bad date math in gradebook dialog

fixes CNVS-12386

test plan:
- setup some assignment with submissions in different combinations of:
  - late / on-time
  - single submission / multiple submissions
- make sure that GB2 correctly differentiates between late and on time in the
  submission details dialog (that pops up when you click in the top right
  corner of a cell)
  - it will be text for a single submission and dropdown for multiple

Change-Id: Ib5f62dd95b073461cfcbea85b1ed8e0805f2a57f
Reviewed-on: https://gerrit.instructure.com/33263
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
make ZipExtractor write files in binary mode

test plan:
 - use rails3
 - create an assignment that accepts file submissions
 - as a student, submit something that isn't plaintext (such as
   an Office document; anything that isn't plain UTF-8 will work)
 - as a teacher, go to the assignment page and select
   "Download Submissions"
 - then refresh the page and select "Re-Upload Submissions",
   and upload the file you just downloaded
 - you should not get a page error

fixes CNVS-12369

Change-Id: I676efc2e8c54419b6bb0ad274d42d0342241a82f
Reviewed-on: https://gerrit.instructure.com/33245
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
calendar2: list favorite courses first

fixes CNVS-12108

test plan:
  * select some favorite courses and some non-favorite courses
  * open calendar2
  * verify that in the sidebar, your favorite courses are listed
      before your non-favorite courses

Change-Id: Ia5f9da19d487d87bf70514fbeae7d9c68c52eb39
Reviewed-on: https://gerrit.instructure.com/33265
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
Updated tr translation
remove OpenDataExport permissions/routes

the gem will handle the process of including them

Change-Id: I2237b4cad388756f91f67138a716ae5a8472d9df
Reviewed-on: https://gerrit.instructure.com/32586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>