Adds visibility for grading_standard_id and grading_standard_enabled boolean to Course Settings API
i18nliner(.rb)

this swaps out (most of) our ruby haax with i18nliner

test plan:
1. verify string extraction:
   1. `rake i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical
2. verify english defaults:
   1. use canvas in english
   2. confirm everything looks correct
3. verify translation keys/scopes:
   1. run canvas w/ RAILS_LOAD_ALL_LOCALES=true and optimized js
   2. use canvas in spanish
   3. confirm that todo está bien
4. confirm you can now use i18nliner-y features:
   1. call `t` without a key
   2. use the fancy erb block syntax

Change-Id: I979479c0889fe7e31ee0c962a4bd1998ab54d711
Reviewed-on: https://gerrit.instructure.com/42785
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Accessibility: Added an aria-label to the view button in Files

Fixes CNVS-16450

Test plan:
- Visit new files.
- Verify with screen readers that it read as "View"; I.E. it's labeled
   properly.

Change-Id: Ief68fb0967d3814ae7d5e2fd76e19aed04e7918e
Reviewed-on: https://gerrit.instructure.com/43388
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
spec: update test_after_commit

My fix was merged upstream.

Change-Id: I43f7b807f65cc738f930616f2a2ee685e78d0981
Reviewed-on: https://gerrit.instructure.com/43502
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fix tool autoresize to account for canvas footer

test plan:
 - load a page with an external tool
 - upon load, the tool should resize to fill most of the window
 - upon resize, the tool should resize to fill the new window size
   - the first resize should not cause the tool's size to "jump"

Change-Id: I59a7d2ab54f8d2e849b38908d59a91b1be09e8cc
Reviewed-on: https://gerrit.instructure.com/43147
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
spec: force draft state on for imported_html_converter spec

not sure why this is necessary, but sometimes these specs seem to still run
with draft state off.

test plan:
- specs should pass

Change-Id: I01b23476859dce519d5858335039a6c3073c8bab
Reviewed-on: https://gerrit.instructure.com/43552
Product-Review: Jon Jensen <jon@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
i18nliner-js (part I)

this swaps out our "parsing" with i18nliner-js

also remove localization abilities of I18n.beforeLabel, since it's not
worth the trouble to support. it can still be called to format a string.

notable changes/fixes in generated yml:
1. client_apps are picked up by i18n:rake so they'll get translated...
   due to the old short-circuiting logic (`rc = rc && ...`), it would
   stop processing scripts within a particular file after the first one
   it found without an I18n.t
2. we no longer incorrectly double-escape special chars in our js strings
   (e.g. newlines are actually newlines, not a literal "\n")

test plan:
1. verify string extraction:
   1. `rake js:generate i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical, except the
      notable changes/fixes listed above
2. verify js translation file generation:
   1. `rake i18n:generate_js` before and after this commit
   2. confirm the files in public/javascripts/translations are identical
3. verify client_app checker still works:
   1. `cd client_apps/canvas_quiz_statistics/`
   2. `grunt check_i18n`

Change-Id: Ic8ad058bee1c9476f42916f10b612c1c08863fe3
Reviewed-on: https://gerrit.instructure.com/42809
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
i18nliner interlude: separate out i18n.js hacks

to facilitate i18nliner.js runtime integration and an i18n.js
upgrade, separate all the tweaks we've made to the latter in
the last 3 1/2 years

vendor/i18n.js is the one we originally started with, i.e.
https://github.com/fnando/i18n-js/blob/61c0396/source/i18n.js

test plan:
1. specs should pass and canvas should not be broken

Change-Id: I40f1118e960ec529a89a4ed0eaae2280f038c946
Reviewed-on: https://gerrit.instructure.com/42893
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
i18nliner-js (part II)

this swaps out (most of) our runtime i18n.js hacks with i18nliner-js

slightly tweak our js htmlEscape implementation (but not behavior) to play
nicely with i18nliner-js

remove auto-scoping abilities of I18n.lookup, but that's not a huge
deal as we didn't really need it

test plan:
1. verify english defaults:
   1. use canvas in english
   2. confirm everything looks correct
2. verify translation keys/scopes:
   1. run canvas w/ RAILS_LOAD_ALL_LOCALES=true and optimized js
   2. use canvas in spanish
   3. confirm that todo está bien
3. confirm you can now use i18nliner-y features:
   1. call `I18n.t` without a key

Change-Id: I93a2763f638f2807a7f804d320409fbdc80f0454
Reviewed-on: https://gerrit.instructure.com/42895
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
i18nliner-handlebars (part I)

extraction and runtime for vanilla handlebars. ember will be part II
because its strings currently don't even get extracted on master
¯\_(ツ)_/¯

differences in generated yml:
1. `%h{...}` placeholders from hbs are just `%{...}`, since html-safety is
   inferred at runtime without needing a placeholder hint (6 occcurrences)
2. inline `{{t ...}}` calls are now extracted (6 occurrences)
3. some trivial whitespace difference around some wrappers (2 occurrences)
4. html-entities are correctly converted into unicode equivalents, e.g.
   `Move To&hellip;` -> `Move To…` (1 occurrence)

test plan:
1. verify string extraction:
   1. `rake js:generate i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical, except the
      differences listed above
2. verify js translation file generation:
   1. `rake i18n:generate_js` before and after this commit
   2. confirm the files in public/javascripts/translations are identical
3. verify hbs translation keys/scope behavior at runtime:
   1. run canvas w/ RAILS_LOAD_ALL_LOCALES=true and optimized js
   2. use canvas in spanish
   3. confirm that todo está bien
4. confirm you can now use i18nliner-y features:
   1. block helper with no key `{{#t}}hello world{{/t}}`
   2. inline helper with no key `{{t "hello world"}}`

Change-Id: Ic2a2c5cf102ca482919cbb91ac1c154467029685
Reviewed-on: https://gerrit.instructure.com/42942
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
i18nliner-handlebars (part II)

extraction and runtime for ember handlebars

test plan:
1. verify string extraction:
   1. `rake js:generate i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical, except the
      now you get a bunch of new ember strings
2. verify js translation file generation:
   1. `rake i18n:generate_js` before and after this commit
   2. confirm the files in public/javascripts/translations are identical,
      plus a whole bunch of new ones for ember
3. confirm you can now use i18nliner-y features:
   1. block helper with no key `{{#t}}hello world{{/t}}`
   2. inline helper with no key `{{t "hello world"}}`

Change-Id: I7bca8aeba462e68f27973fa801e7f7dbc7b3c9ef
Reviewed-on: https://gerrit.instructure.com/43158
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Product-Review: Jennifer Stern <jstern@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
restrict verifiers to public file links in calendar event export

test plan:
* create a calendar event for a private course with a link
to an unlocked attachment
* sync the calendar with an external source
* the exported calendar event should not add a verifier to
the link (and thus allow someone to bypass authentication)

* repeat for a public course
* should add a verifier this time

closes #CNVS-15352

Change-Id: I743e73dc852c204cdf68c0b8b9e3fc2d402ad855
Reviewed-on: https://gerrit.instructure.com/43288
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
course link validator + API

test plan:
* the course link validator should look at all user supplied
 HTML content in a course and return a list of bad links:

 - links to external content that does not return
 a valid response (i.e. dead links).
 - misconfigured urls
 - links created by missing file references in imports

* use the (currently) undocumented link validator API

POST /courses/:course_id/link_validation
 - Starts a link validation process

GET /courses/:course_id/link_validation
 - Gets the current process status
 and results (if processed)

* should return a list of items in a course, the
 bad urls, as well as a direct link to the item (for the
 future UI to follow)

refs #CNVS-15162

Change-Id: I613fff7d603e133cc155e5fb33c7f257affe0f48
Reviewed-on: https://gerrit.instructure.com/42821
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
allow bundler 1.7.4

Change-Id: Ib4f399df45a74a6dcf1ab6d3bedc6bf99f659afc
Reviewed-on: https://gerrit.instructure.com/43374
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fix delayed alerts for courses with only section-limited teachers

fixes CNVS-16376

test plan:
- enable account alerts in account settings
- enroll a teacher in a course as section limited (they should be the only
  teacher)
- make sure the teacher has a verified email address
- visit the teacher's notification preferences page to make sure there is
  a notification policy set up for the alert notification.  confusingly, this
  is not the same as the "Alert" section on the page, this notification policy
  actually cannot be customized, but visiting the page will create it if it
  doesn't already exist.
- the annoying thing about this alert notification policy is setup is that it
  is set up to be a 'daily' policy, and it can't be customized.  this means
  that even after the job runs and creates the message successfully, it won't
  actually be sent until the following daily batch. to fix this for testing,
  you can make the notification policy immediate by running the following in
  a rails console:
    ```
    NotificationPolicy.
      where(:notification_id => Notification.by_name("Alert")).
      update_all(:frequency => "immediately")
    ```
- now set up an alert and trigger the conditions for the alert
- alert messages are only computed once per day at 11:30 utc. since this is
  an inconvenient time to have a patchset checked out, the easiest way to make
  this happen manually is to run the following in a rails conosle:
    `Alerts::DelayedAlertSender.process`
  however, be aware that this job sets a redis key after it runs to make sure
  notifications don't get sent twice to the same person, so if you do need to run
  it twice in one day for some reason, clear redis between runs.
- the alert message should be sent.  if you set up a real email address you
  should receive the message, or you can check that it was sent by using the
  "View Notifications" tab in the admin tools section of the account.

Change-Id: I3e7dc66975eb666bb498a995a5058d37b991fa91
Reviewed-on: https://gerrit.instructure.com/43138
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
fix issue resaving a quiz after updating a question without saving

caused by a regression from updating routes for rails 4

fixes CNVS-16474

test plan:
  - as a teacher
    - create a quiz with a question
    - publish the quiz
    - update a question on the quiz, but don't save the quiz itself
    - refresh the page
    - you should get a notice that 'you have made changes to questions...'
    - click the 'save it now' button
    - it should save successfully

Change-Id: Id1a8ea918d5d968c63e883c8ee145222ab55a0b9
Reviewed-on: https://gerrit.instructure.com/43560
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Green Quiz Icon

Fixes: CNVS-16220

Notes:
- Updated selector to include quiz icon

Test Plan
- Publish the quiz
- Navigate to the quiz index page (courses/:id/quizzes)
- Observe the 'Q' icon next to the quiz title is grey, but should be green.

Change-Id: I5203d1ce335e4faa54743befb69fbd4aa9f6ec84
Reviewed-on: https://gerrit.instructure.com/43553
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
update feature flag documentation for 'hidden_in_prod'

refs CNVS-16352

Change-Id: Icfbfce03c48a48fbe07f531be90406fe278f2a8d
Reviewed-on: https://gerrit.instructure.com/43389
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
fix dnd move in IE 10

fixes: CNVS-16386

test plan:
in IE10 and a couple other browsers we support,
go to newfiles
drag-n-drop a folder in the main pain to move it
to something in the left pane.
it should work

Change-Id: Idb078a7aad13528506ed44e20a77ae16f80cbb30
Reviewed-on: https://gerrit.instructure.com/43555
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
fix permission check in users/_name partial

fixes CNVS-16479

the can_manage_admin_users variable -- meant to help control whether the
acting user can edit/become/merge/delete the shown user and also whether
the acting user can edit the shown user's time zone -- was always
truthy, since even an empty array is truthy

test-plan:
 * given Bob is a teacher and Sally a TA in the same course, with Sally
   logged in
   - visit /courses/:that_course/users/:bob
   - Sally should not see the "Edit" link

 * given Bob is a student and Sally a TA in the same course, with Sally
   logged in
   - visit /courses/:that_course/users/:bob
   - Sally should see the "Edit" link
   - after clicking the "Edit" link, Sally should not be able to change
     Bob's time zone.

Change-Id: I429a0752a034cc5ff10962dcbacee747cd6ec650
Reviewed-on: https://gerrit.instructure.com/42774
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>