Sort terms drop-down lists by start date

Terms are easier to select when they are sorted consistently.

Test Plan:
* Create 3+ terms in a different order than their start dates
* Verify terms are sorted in chronological order by start date:
  * /account/### (right sidebar under Course Filtering)
  * /account/### (click Add a New Course; in the dialog)
  * /account/###/users (right sidebar under Choose Term)
* Terms should be sorted the same way as the drop-down list in:
  * Course Settings > Edit Course Details
Improve efficiency of sorting term drop-down lists
Ensures that all folders will be listed in wikiSidebar file upload
folder list regardless of the order in which files are processed.

Fixes #363

Before testing commit:
 * Create a folder in a course which comes before "course files" alphabetically.
 * Edit a page. Open the "Files" tab in the sidebar.
 * Click "Upload a new file."
 * Note that the folder you created (for example "class lectures") is not present in the list of folders to which you can upload.

Test plan:
 * Create a folder in a course which comes before "course files" alphabetically.
 * Edit a page. Open the "Files" tab in the sidebar.
 * Click "Upload a new file."
 * Note that the folder you create (for example "class lectures") IS present in the list of folders to which you can upload.
only query grades for students (not observers)

fixes CNVS-9064

test plan:
 - with draft state on
 - view the assignment index page as an observer
 - the page should look like the student page, but
   the grades should like like it does on the teacher page
   ('35 pts' and not '-/35 pts')

Change-Id: I02bd086c3fdb82d49300a986eba5a7694337b6d7
Reviewed-on: https://gerrit.instructure.com/26137
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
spec: mark failing conversations spec as pending

Change-Id: I511aba17318f7ea5f8f331cabf5ddb721a2f0392
Reviewed-on: https://gerrit.instructure.com/26285
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
spec: fix intermitten outcome_specs for all-plugins nightly

Change-Id: I7d3374cb0544e1ac3a54cf247d6d0bcb00f3b0b8
Reviewed-on: https://gerrit.instructure.com/26275
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Kyle Rosenbaum <kyler@instructure.com>
make header tabbable on assignment edit page

added role=heading and tabindex to "Published" to make tab-navigation
easier

fixes CNVS-7784

test plan
=========

- enable draft state
- navigate to the assignment edit page
- verify that the "Published" span can be tabbed to

Change-Id: I96836056606b45b07ab5c5e790a5245ac7f64390
Reviewed-on: https://gerrit.instructure.com/26191
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Aaron Cannon <acannon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes reading of publish/unpublish button with screenreader

fixes CNVS-9253

test plan
- using screenreader on assignment show page
- publish and unpublish an assignment
- verify that title/description of button are read correctly and not mashed together
- verify that the correct status titles are displaying on the index page

Change-Id: Ib332a286ee4b89a6b008df5e572e233b0d0a4f6b
Reviewed-on: https://gerrit.instructure.com/26189
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
add id to allow focus of assigment menu

data-focus-returns-to was not working for move and edit actions since
the id it was looking for didn't exist

changed DialogFormView to ensure that close is called in the jquery ui
dialog close callback-this means that focusReturnsTo will be called when
using the ui close button or @el.dialog('close')

made screenreader-only for the assignment menu come before the icons for
consistency

fixes CNVS-9235

test plan
=========
- enable draft state
- open the "Move To" or "Edit" dialog for an individual assignment
- close the dialog either by saving or canceling
- verify the focus returns to the cog menu for that assignment
- verify the above works as expected with screenreaders

Change-Id: I41e1ea07bfed6a1eb32b23a420949465bb023f8c
Reviewed-on: https://gerrit.instructure.com/26002
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Matthew Irish <mirish@instructure.com>
spec: public_courses_spec

separate public courses spec

Change-Id: I12d0f7df432a62564db0070fe9a12390a05f55e3
Reviewed-on: https://gerrit.instructure.com/26096
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
better handle varying number of parts for mailer

in the rails2 shim. refs CNVS-9184

test-plan:
 - configure canvas to send outgoing email
 - configure a user with a real eamil address and set notifications for
   this user to asap
 - have a different user initiate a conversation with the first user
 - check for a notification email from the conversation
   - entire email should have content-type multipart/alternative with
     both text and html parts
   - text part should have content-type text/plain
   - html part should have content-type text/html
   - both parts should have charset=utf-8 in their content-type
   - html format should still be displayed by default

Change-Id: I0dd1cf7aad6d51e808438946bce172d256ffceb7
Reviewed-on: https://gerrit.instructure.com/26295
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
adds high-contrast theme user preference

test plan:
* log in as user1
* go to user1's user settings
* click "Edit Settings"
* change "Enabled Theme" to "High Contrast"
* navigate to /styleguide
* verify that main header is darker (higher contrast)
* verify that the buttons at /styleguide#buttons have
** higher contrast
* log in as user2
* go to user2's user settings
* verify that the "Enabled Theme" is "Default"
* verify that the header is grayish (not as high contrast)
**********************************************************
* add a global css that changes something easily testable
** such as the header
* verify that the global css takes precedence

Change-Id: I7ce520be63ad639a77c603d7b3177df334750b15
Reviewed-on: https://gerrit.instructure.com/24787
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
spec: intermittent selenium spec fixes

Change-Id: I41ee55e482075a9b8e15e5d8db2649bcd8c5e468
Reviewed-on: https://gerrit.instructure.com/26291
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
fix height of events during resizing

fixes CNVS-9297

test plan:
  * enable agenda view;
  * navigate to calendar2, and select week view;
  * create a new event, then attempt to resize the event
    by dragging it;
  * verify that the event height during dragging matches
    what its final height will be/the hour lines in the
    view.

Change-Id: Id65bac72d74606f6d40748125c0b59ee3151a82c
Reviewed-on: https://gerrit.instructure.com/26279
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
add "skip to calendar" link in calendar2 sidebar

fixes CNVS-9233

test plan:
  * using voiceover w/ safari or jaws, navigate to
    calendar2;
  * navigate through the header to the sidebar and verify
    that the first item in the sidebar is a link that reads,
    "skip to calendar;"
  * verify that clicking the link jumps focus to the main
    content area just about the calendar header.

Change-Id: I841b685bac69792742f8e1031e1a36c1667dfb72
Reviewed-on: https://gerrit.instructure.com/26283
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
Merge pull request #358 from sfu/fix-term_sorting

Sort terms drop-down lists by start date
fixes JAWS reading of manage cog wheels for IE9

fixes CNVS-6842

test plan
- as a teacher with draft state enabled
- using JAWS and IE9
- go to assignments index page
- tab over to Assignment Group cog
- interact with cog menu and read the "Edit" menu item
- it should only read "Edit" menu item once
- repeat for Assignment cog wheel

Change-Id: If0efcdf46fa43d15da28d75a2626bae6c98e390a
Reviewed-on: https://gerrit.instructure.com/26156
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
Reviewed-by: Aaron Cannon <acannon@instructure.com>
properly sort by lastname, firstname

fixes CNVS-2330

Test plan:
  * make a course with students named "Ball Wall" and
    "Shmallart Wallart"
  * In gradebook2, "Ball Wall" should be listed *above* "Smallart
    Wallart"
    * only in chrome though... other browsers don't support the locale
      options we need
  * In gradebook.csv, "Wall, Ball" should be listed above "Wallart,
    Shmallart"

Change-Id: I7f20e81cc55b4ee962b2cca32cc48e6c49c48472
Reviewed-on: https://gerrit.instructure.com/26236
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
stringify audience field in conversations api if requested

fixes CNVS-9374

test plan:
 - call conversations api endpoints that return an "audience"
   parameter. See that it returns numeric ids for audience in
   the result.
 - make the same calls and add the
   "Accept: application/json+canvas-string-ids" header to the
   call. See that it returns strings ids for audience in the
   result (as well as all the other id fields).

Change-Id: I0ee5dea4ec50c7cecfd33c2112f26be904f46806
Reviewed-on: https://gerrit.instructure.com/26298
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
improve agenda view date range and load more accessibility

also reworked the flash message helpers so the screenreader
elements aren't animated because the animation would cause
screenreaders to read the elements multiple times. added a
polite screenreader message region.

fixes CNVS-9220

test plan:
 - check the header datepicker suggestion text is read by
   screenreaders when you type a date, such as "nov 15".
 - check invalid dates (such as "p") are read as invalid.
 - check that the updated date range is read when the agenda
   view finishes loading.
 - when "load more" is clicked, check that the first new date
   receives focus when the new dates are loaded.
 - when "load more" is clicked, check that the new date range
   is read when the new dates are loaded.

Change-Id: If706b80745caf56bf231b5b73d0f12512199b6ed
Reviewed-on: https://gerrit.instructure.com/26019
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>