log error reports in the root_domain_accounts shard

fixes: CNVS-15074

Wraps the log_exception method in a shard.activate for the
domain_root_account.  This is required because the method gets called
after the LoadAccount middleware has been called.

Test Case:
  - Create an error on one shard, such as going to localhost:3000/42 to
    raise a 404.
  - Open the shards error reports and the error should be in the list.
  - Open the default account and the error should not be in the list.

Note:

Need to add the following to config/environments/development.rb.
Without this the error won't be logged.  Rails3 will not call the log
method in the middleware.

  config.consider_all_requests_local = false

Change-Id: I2b8c3fd3fc714ab75cf3b872e6546ffd651e6882
Reviewed-on: https://gerrit.instructure.com/40610
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
add ui notification of bouncing channels

test plan:
 * add various communication methods to your user
 * navigate to any page other than your user's settings
 * using the console, increase the bounce count of all channels:
     User.find(id).communication_channels.unretired.each do |cc|
       cc.bounce_count = 100
       cc.save
     end
 * refresh the page
	 - a notification should show at the top of the page, indicating a
	   potential problem on your settings page
	 - navigating anywhere other than the settings page will cause the
	   notification to persist

 * navigate to the settings page
   - the notification should disappear
   - your communication channels should all indicate a problem with
     delivering messages to you
 * removing and re-adding the channels should remove all indicators

 * navigate to any page other than your user's settings
 * using the console, increase the bounce count of one channel:
     cc = User.find(id).communication_channels.unretired.first
     cc.bounce_count = 100
     cc.save
 * refresh the page
   - once again, the notification should show at the top of the page

fixes CNVS-15255

Change-Id: If45664c1b33d75fbfe8aa3480dfebd8872c6b064
Reviewed-on: https://gerrit.instructure.com/40534
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Janelle Seegmiller <jseegmiller@instructure.com>
add tool setting service

fixes PLAT-608 PLAT-613 PLAT-615 PLAT-616 PLAT-620

test-plan
*spec should pass

Change-Id: Idf2a7d89973231a070a8d368bd60554e3501cdf6
Reviewed-on: https://gerrit.instructure.com/40227
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
leave context host for attachment_json in reports

attachment_json will do this for you.
this prevents double  context information from the
merge of options in attachment_json

refs CNVS-10842

test plan
 - run report with canvas on port 3000
 - report object response should have the correct
   attachment download url

Change-Id: I58caffede266dee157afab63fd82a0a4a4bd5213
Reviewed-on: https://gerrit.instructure.com/40638
QA-Review: Dave Jungst <dave@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
respect locale preferences on new user account confirmation failure page

fixes CAT-464

Test Plan
  1. Fire up canvas with full i18n support configured
     (i.e. $ RAILS_LOAD_ALL_LOCALES=true rails server)
  2. Submit a POST request to the canvas api to create a new user
     (i.e. '/accounts/:id/users') with request headers [:user][:locale]
     set to a supported canvas locale (i.e. 'zh')
  3. Navigate to the new user account confirmation page from the email
     link, set a password and submit the form
  4. With your new user still signed in, navigate back to the confirm URL
     and ensure the page is still localized
  5. Logout from canvas and navigate back to the confirm URL again and
     ensure the page is still localized

Change-Id: I47127098f88b53d9b66b2a739cc4fd8836f14523
Reviewed-on: https://gerrit.instructure.com/39661
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Gunderson <egunderson@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Product-Review: Dave Donahue <ddonahue@instructure.com>
QA-Review: Dave Donahue <ddonahue@instructure.com>
Converts wiki page title to use h1 rather than h2

fixes CNVS-14906

Test Plan:
  1. Navigate to a page under Pages in a course
  2. In VO, press ctrl+option+cmd+h to go to the first and
     only header
  3. Press a second time to confirm that there are no more
     headers
  4. Hold shift while pressing those same keys to confirm that
     there are no previous headers
  5. Header should be recognized as a H1

Change-Id: I29ee832829581f08e23f0d3b01a264e908c67deb
Reviewed-on: https://gerrit.instructure.com/40673
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
add lti launch params and substitutions

test plan:
  - create a tool with ContentItemSelectionResponse
  - it should send the parameter 'tool_consumer_instance_contact_email'
  - it should substitute the parameter $Canvas.user.prefersHighContrast

fixes PLAT-622

Change-Id: If55d0a1b488f82a90c8aa620fd037f7e7c7b0272
Reviewed-on: https://gerrit.instructure.com/40703
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Color Variables for Canvas UI

fixes CNVS-15117

These introduce color variables for Canvas! With these
fancy variables we can now start getting color consistency through
Canvas! Huzzah!

UI Testing:

- Compile sass
- Compile styleguide (bundle exec rake css:styleguide)
- There are two separate styleshees: one for legacy, one for new;
these are being hidden or shown based on css
- See QA procedure below for expected testing results

QA Testing:

- With the new_styles tag off, in /styleguide you should see a
"Canvas Colors - Legacy" section with Base Colors & High Contrast
- Width new_styles flag on, in /stylguide you should see a
"Canvas Colors - New" section with Base Colors & High Contrast
- You should never see two Canvas Color sections at a time

Change-Id: I2536ce5bf49bc0de2166cdcd8f3be15be9ff6625
Reviewed-on: https://gerrit.instructure.com/40309
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
Reviewed-by: Chris Hart <chart@instructure.com>
No more textures in Canvas

fixes CNVS-15254
fixes CNVS-14958

This takes out the big textured backgrounds we have in Canvas and
makes everything flat. I've attached screenshots to the story to
see what all is being changed. This affects the following areas:

- Main global header
- Main sidebar left nav
- Body background

This also takes off some annoying drop-shadows we had on the user
navigation (top right) and the global Courses drop-down box.

Yay for a cleaner looking Canvas!

Testing:

- Load up Canvas, make sure the color changes appear for you and
match the screenshots

Change-Id: I3557e66d7d91c3999ad67bfa92202e61c7da44cb
Reviewed-on: https://gerrit.instructure.com/40527
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Reviewed-by: Chris Hart <chart@instructure.com>
send user id for ContentItemSelectionResponse launches

test plan:
 - Install a tool with a message type ContentItemSelectionResponse
 - it should contain a opaque user_id

Change-Id: Ic2f6585adfe2d9792f974d1d58db2b82da2cdff2
Reviewed-on: https://gerrit.instructure.com/40718
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
initialize rack-mini-profiler for rails3

fixes: CNVS-15198

Test Plan:

  - Make sure you have Application Profiling permission.
  - Add ?pp=enable to the end of the url.
  - A profiler output will apear in the top left corner of the screen
    showing that it ran for the request.
  - Add ?pp=disable to the end of the url.
  - The profiler output button should be gone.

Change-Id: I6fa2dee3affa388d07c6eccf05c26c0747ddcd79
Reviewed-on: https://gerrit.instructure.com/40312
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
DA - notifications for assignments

fixes CNVS-13933

test plan (with a course setup for DA):

for the following tests:
* perform them on assignments that are only_visible_to_overrides
* _and_ again on assignments that should be visible to everyone (regression)

- mute an existing assignment that has a due date for one section only
- unmute it
- verify that the *unmuted* notification only go to the students & admins who can see the assignment

notes: must be an existing assignment that is more than 30 minutes old

Change-Id: Ic26fe29a8b1db06e376fdeae129636b0a097fab1
Reviewed-on: https://gerrit.instructure.com/37271
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
require course assignment groups in a saner way

fixes CNVS-15252

test plan:
- create a new course and DO NOT visit the assignment index page
- go create a new ungraded discussion
- refresh the discussion show page a few times
- go to the assignment index page
- there should only be 1 assignment group (the default)
- repeat the process with an ungraded quiz

Change-Id: If6714bef05379a0f1253a0843d473695a1372456
Reviewed-on: https://gerrit.instructure.com/40709
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Show full timestamps on conversation messages

Fixes CNVS-13871

Test plan:
  - Create and send a conversation message
  - Locate the message under "Sent" and click on it
  - Ensure that the the full date and time, including the year, are
    displayed in the upper-right corner of the message

Change-Id: I00c3c0df252dc8e32e4aeb2567460c7507750dda
Reviewed-on: https://gerrit.instructure.com/40675
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Janelle Seegmiller <jseegmiller@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
use ruby 2.1 compatible mocha with all versions of ruby

makes the lockfile the same between 1.9 and 2.1

Change-Id: I3ab1c3c7a7fcb8e6a5aba0170744d04739029209
Reviewed-on: https://gerrit.instructure.com/40753
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fix double requiring of application.rb

This happens when script/rails is executed via a symlinked canvas
directory

Change-Id: I64fc408244ead13c3c78580c3b3e72102445df34
Reviewed-on: https://gerrit.instructure.com/40740
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Updated es translation

Change-Id: Ic8301c484cb63827abd5e368766e4ad46f40621c
Updated de translation

Change-Id: I22cbbf7c6fee0bca7dba3f6584da8149ec4a2e1c
Updated ru translation

Change-Id: I1fa3916dec52d8e2e95c0580638e5c3c7b9a1047
Updated fr translation

Change-Id: I02c67a56dd50c880e4813f6df7ee31fea00845ae