improvements to "unread" filter view on discussions

fixes CNVS-5713

testing instructions:
=====================
on the "Unread" filter view:
* the "read status" icon should display to the left
  of the entry
* the "read status" icon should be a link that toggles
  the status of the entry. the full list view
  should have the same state indicator.
  reloading should preserve the toggled state.
* toggling the "read state" in the full list view
  should make it appear or disappear from the unread
  filter view
* hovering over the "read state" should show tooltip
  that says "Mark as Read" or "Mark as Unread" to
  match displayed state.
* verify behavior in announcements

Change-Id: Ic05e35250a10b2f69e88ad24af1db739146a7463
Reviewed-on: https://gerrit.instructure.com/20543
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Mark Ericksen <marke@instructure.com>
fix guard run_on_deletion issue

use correct method name so guard doesn't die when a handlebars template is
removed

test plan:
1. start guard
2. create a handlebars template
3. confirm the .js file gets created
4. delete the template
5. confirm the .js file gets deleted
6. guard should not asplode

Change-Id: I58456ef9d7d4a9bdaffb8d61d39d7e22c42d8d1a
Reviewed-on: https://gerrit.instructure.com/20605
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
add aria-labels to calendar event edit form inputs.

fixes CNVS-5688

test plan:
  * click on a new or existing calendar event, and then
    click the "edit" button;
  * click the "more options" button;
  * navigate this page with a screen reader and verify
    that input labels are read.

Change-Id: Ic8f147b02dca09f113853367325e84ae57bc491e
Reviewed-on: https://gerrit.instructure.com/20537
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
should return admin for custom admin

fixes PS-271

test plan
-create custom admin role
-launch lti tool, admin role is avail.

Change-Id: I4f93eee990e8b89cf6265a3fee19bafdb7ef62a4
Reviewed-on: https://gerrit.instructure.com/20017
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
fixes mysql bug in temp table for reports

mysql requires auto_increment columns to be defined as a key

test plan
 - using mysql run the Student Assignment Outcome Map Csv report
 - report should not fail

Change-Id: I092e66e3e108e677b24a773bc5a46f118110ef8a
Reviewed-on: https://gerrit.instructure.com/20261
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
don't load translations in test mode by default

test plan:
1. the tests should pass (some will be pending)
2. the tests should also pass with RAILS_LOAD_ALL_LOCALES=1

Change-Id: Iff4f61dc747639bdc522f85cf16d44421e6a41f4
Reviewed-on: https://gerrit.instructure.com/20530
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
prevent collaboration titles longer than 255 char

fixes CNVS-3371

testing instructions:
=======================
* in a course on the "Collaborations" tab,
  click the "Start a New Collaboration" button
* in "Document name" input text longer than 255
  characters
* hit button "Start Collaboration", an error
  ballon should appear on the document name input
  telling the limit and offering a helpful hint.

  Text: "Please use 255 characters or less for the name.
         Use the description for additional content."

* verify a collaboration works when size is less than
  or equal to 255 characters.
* verify the document name is still required
  (i.e. can't be blank)

Change-Id: Iea6e5d5243389866f62ab24c6869361b6e3a4e47
Reviewed-on: https://gerrit.instructure.com/20602
Product-Review: Mark Ericksen <marke@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Mark Ericksen <marke@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix notification table layout on resize. fixes CNVS-5575

test plan:
  * create a user w/ at least three active communication
    channels;
  * navigate to the notification preferences page and
    resize the browser window horizontally; verify that
    the table cells all remain aligned.

Change-Id: I59c7000488b524bb171f4c7880772eddf383be6f
Reviewed-on: https://gerrit.instructure.com/20625
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
match threaded discussion styles to non-threaded.

fixes CNVS-5710

test plan:
  * create a threaded and an unthreaded discussion;
  * create content in both discussions;
  * verify that they both work as expected and share
    the same styles.

Change-Id: Ia90590ae6e2a4fe9890d341c129be0b73abf5f93
Reviewed-on: https://gerrit.instructure.com/20593
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
use right host names on communication channel merge emails.

fixes CNVS-1608

test plan:
  * on a canvas installation with multi-tenancy enabled
    and cassandra being used for global lookups, create
    at least two accounts (A and B) on the same shard that
    don't share domain names;
  * create an active user account in account A;
  * create a duplicate user in account B through an SIS
    import;
  * verify that the duplicate user receives a merge
    notification and that the link in the email properly
    references account A, while the domain in the
    notification body references account B.

Change-Id: I44f84c082b319dd9129da8422a9e4c8c03103a13
Reviewed-on: https://gerrit.instructure.com/20615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
fixes ambiguous query in sis_export 

fixes CNVS-4439

test plan
- specs should pass

Change-Id: Iede9966c6979cc7682096e14d1651dcb84a5396b
Reviewed-on: https://gerrit.instructure.com/20636
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
better i18n wrapper inference

* actually check if tags are balanced (not just innermost tag)
* allow single closed tag on either side of content (e.g. for an icon)

test plan:
N/A, see specs. i18n:check should also pass

Change-Id: I1ecbce833ab35955e21e40a2d2404de4aa1b359f
Reviewed-on: https://gerrit.instructure.com/20565
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
adds role counts to people view drop down

fixes CNVS-5753

Test plan:
1) Go to People view
2) Click Role select input
3) Verify that counts are correct

Change-Id: I03c0b767632c15e77e75605e7c270985da860b4d
Reviewed-on: https://gerrit.instructure.com/20419
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
increment/decrement method for Backbone model attributes

more concise way to change a value so you don't have to get+set

test plan:
n/a, see specs

Change-Id: I94383d55f748cf02db1298491178962f01015e00
Reviewed-on: https://gerrit.instructure.com/20610
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
adding additional api support for the app center

Reworked how the calls were passed through to take advantage of the
app center pagination.  Also added an endpoint for retrieving app reviews.

The following canvas api calls should work, after configuring the app center plugin
 - /api/v1/accounts/:account_id/app_center/apps
 - /api/v1/accounts/:account_id/app_center/apps/:app_id/reviews
 - /api/v1/courses/:course_id/app_center/apps
 - /api/v1/courses/:course_id/app_center/apps/:app_id/reviews

These should also accept a page and per_page params

Change-Id: I15fe1225c01d04bc2ad6efa1736013b88e541c51
Reviewed-on: https://gerrit.instructure.com/20455
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Brian Whitmer <brian@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
return content_id in module items api

fixes CNVS-5807

test plan:
 - index or show action for module item should show the id
   of the referenced object (content_id), if it has one
   - note that wiki page ids are not exposed by the api

Change-Id: I05748fa562b9e7cb5a775b6c8e40a5ff2e835f01
Reviewed-on: https://gerrit.instructure.com/20525
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
fix quiz submission notifications

FIXES CNVS-5540

make graded notifications come from quiz
submissions and not from regular submissions
so that we can accurately differentiate
between "graded" and "regraded".

Also makes sure that no messages get sent until
after essay questions on quizzes are graded.

Finally extracts the quiz_submission broadcast
policy into it's own object because there's
a lot of repetition there (did the same
for submission broadcast policy since I
was touching it anyway, could be a good pattern
for other broadcast policy definitions)

TEST PLAN:
  1) Log in as a student
  2) take a quiz with an essay question
  3) you should NOT get a notification
  4) login as a teacher, and grade that quiz
  5) the student should get a notification that
  their quiz has been graded
  6) that notification should NOT say that the
  quiz has been RE-graded.
  7) repeat, but grade from gradebook instead of
  speedgrader

Change-Id: Id057f6d7abb64906c03334031d0d66af1e25adb2
Reviewed-on: https://gerrit.instructure.com/20511
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fix changing an ungraded survey to a graded quiz

test plan:
  - as a teacher, create a graded quiz and save the quiz
  - edit the quiz again, and change the type to ungraded quiz
  - edit the quiz AGAIN and chang the type back to graded quiz
  - You should get redirected like you did in all the other edits, and
    you shouldn't get stuck on the quiz edit page with "Saving..." stuck
    on the button.

fixes CNVS-5643

Change-Id: Icd0ed4609e9eeeb5e3e565eaa07628367bb71f0a
Reviewed-on: https://gerrit.instructure.com/20645
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
change learning outcome groups index

remove the partialness. we do some queries without specifying
"learning_outcome_group_id IS NULL", so make the index useful to
that query as well

Change-Id: I7f96a93f8cf868afdc45680b34e536c110834f71
Reviewed-on: https://gerrit.instructure.com/20581
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
create 'page' type module items through API using wiki page url

test plan:
* create a module item through the api of type 'page' by
setting the 'page_url' attribute to the 'url' of the
desired wikipage (since the id is not exposed in the api)
* in index and show actions, confirm that the 'page' item
includes a 'page_url' attribute

Change-Id: Ie39bf8b4b58eeed3d98e51843a26b592cc2746b0
Reviewed-on: https://gerrit.instructure.com/20608
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>