display "(no subject)" for conversations w/o subjects.

fixes CNVS-7433

test plan:
  * create a conversation without a subject;
  * navigate to the new conversations interface;
  * verify that both on the conversation detail and in the
    conversation list on the left of the interface display
    "(No subject)".

Change-Id: Id1ab9077ff19c690f3449a591c68860411a90e65
Reviewed-on: https://gerrit.instructure.com/23219
QA-Review: Cam Theriault <cam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
make slow migration postdeploy

slow migrations that aren't strictly necessary for the new code
should wait until after the deploy

Change-Id: I1bc5837567bccddd3babff57495d46996e45508b
Reviewed-on: https://gerrit.instructure.com/23229
Reviewed-by: Paul Hinze <paulh@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
require terms by default, fixes CNVS-7330

they were required prior to our new settings refactors. this way we don't
need to go set it in prod

test plan:
1. terms should be required when registering at /register
2. terms should be required when activing an account (via course
   invitation email)
3. in the console, do Setting.set('terms_required', 'false')
4. terms should no longer be required on those pages

Change-Id: Idb13727839b847845cd4dacde4797e4e1571b42f
Reviewed-on: https://gerrit.instructure.com/22988
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
page revisions api

test plan:
 1. consult the Pages API documentation, and notice
   (a) the new "List revisions" endpoint
       and the PageRevision data type it returns
   (b) the "Show revision" endpoint
       (which can accept an id or "latest")
   (c) the "Revert to revision" endpoint
 2. exercise these endpoints as a teacher
   (a) note that reverting a page should not change
       editing roles, hidden, or published state
 3. exercise these endpoints as a student
   (a) students should not be able to list,
       or retrieve prior revisions unless they have
       edit rights to the page
   (b) all students (who can read the page) have permission
       to get the latest version (but edit rights
       are required to get a specific revision number)
   (c) for the revert action, the course permissions must
       allow students to edit wiki pages; if the course
       does not grant wiki edit rights to the student,
       but the page does, the student can change page content
       only (cannot revert or rename)
   (d) for the show revision action, the permissions of the current
       version of the page are applied; students with edit rights
       to it can view or revert to previous versions that
       may have been hidden or unpublished (in other words,
       "hidden" and "unpublished" apply only to the current
       state of the page, not historical versions of it)

fixes CNVS-7301

Change-Id: Ie4948617e24154a61f3111e08fc3f89b9265da6d
Reviewed-on: https://gerrit.instructure.com/23088
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
new conversations ui message sending

fixes CNVS-7329

test plan
- send some messages from the new ui
- ensure that users on the old and new ui can see them and that
 they were sent to the right recipients

note: the new ui does not automatically refresh when sending, so
you won't see the new message

Change-Id: I98e73f845c2012bc2e5367b9363b728e9ffd902a
Reviewed-on: https://gerrit.instructure.com/23207
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>
extract EventStream::Index#select_cql

refs CNVS-6755

cleans up code a little, there will be times we need this same snippet
elsewhere

test-plan: N/A

Change-Id: Ia210165f7799b97a825eff0d91c5d3afc416012d
Reviewed-on: https://gerrit.instructure.com/22974
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
make EventStream#fetch_cql public

refs CNVS-6755

Change-Id: I419692e2c2f779091a58bba21288421252124b95
test-plan: N/A
Reviewed-on: https://gerrit.instructure.com/23075
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
ttl_seconds should take timestamp, not record

refs CNVS-6755

there are times we'll want to know it for a given timestamp that's not
necessarily in an instantiated record's created_at.

test-plan:
  - specs pass
  - PageView::EventStream.ttl_seconds(Time.now) should give a value

Change-Id: I6a37810711bb782474e66153a3cf53ace1b55070
Reviewed-on: https://gerrit.instructure.com/22931
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
create foo_index accessor when adding index :foo

refs CNVS-6755

to allow referring to the indexes directly

test-plan: [in script/console]
  # should be able to refer to page view's user index
  index = PageView::EventStream.user_index
  # select a user with page views
  user = User.find(some_user_id)
  # index should be the one underlying PageView::EventStream.for_user
  coll1 = index.for_key(user.global_asset_string)
  coll2 = PageView::EventStream.for_user(user)
  coll1.paginate(:per_page => 3) == coll2.paginate(:per_page => 3)

Change-Id: I5bc481ed1ef61543acd36f800bdcc56a6df4e554
Reviewed-on: https://gerrit.instructure.com/22930
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
roll TempTable up into ActiveRecord itself

removes the confusing options, and simplifies because it has direct
access to the class members that it needs. especially, this made
it trivial to add support for preloads via includes on the scope.

Change-Id: Ia98987de8c4f2ab697781af00bce5006ff456cf3
Reviewed-on: https://gerrit.instructure.com/22669
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
conversations: fix compose field spacing

fixes CNVS-7436

test plan:
  * open conversations beta
  * open compose dialog
  * verify that spacing on Course, To, and Subject rows
      match the mockup

Change-Id: I6773a1bbc8717bca394e3aea222a749a37e502e7
Reviewed-on: https://gerrit.instructure.com/23233
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
unblack gear menu links

fixes CNVS-7439

test plan
- ensure help and gear menu item in new conversations ui are white

Change-Id: I865c691d540382145327305423d0ec6ba6a7af9d
Reviewed-on: https://gerrit.instructure.com/23235
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
data fixup for page view url param filtering

fixes CNVS-7202

test plan:
* without the CNVS-7202 commits,
  make an api request that gets logged as a page view such as
  /api/v1/courses/X/discussion_topics?access_token=XXX
* then apply this commit and run the data fixup, and verify that the
  data was fixed in the page views store (test with both db store and
  cassandra store)

Change-Id: Id10e1ba69cd8c82797fd5b7bcf6309afa0773288
Reviewed-on: https://gerrit.instructure.com/22729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
conversations: add subject placeholder to compose dialog

fixes CNVS-7437

test plan:
  * open new conversations compose dialog
  * verify that subject field contains "No subject"
      when starting a new message or continuing
      a conversation with no subject
  * verify that placeholder disappears on entry
  * verify that contrast between placeholder text and
      background is reasonable when input is disabled

Change-Id: I5c6b084c1691af7e782beb099212373372f7a097
Reviewed-on: https://gerrit.instructure.com/23234
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
only create page versions on content change

test plan:
 * editing a page (through the UI or API)
   - saving changes to a page should only create revisions when body or title are changed
 * editing a page as a different user
   - saving non-content changes as a different user should not create a new revision

fixes CNVS-7247

Change-Id: Icbcafc8ce70f82908b3b517a9eb5ce09bd0bae09
Reviewed-on: https://gerrit.instructure.com/23178
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
hush postgres

Change-Id: I4a712a4f47ce7e2ef91e2c8710c6a58561d999ac
Reviewed-on: https://gerrit.instructure.com/23238
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
update fake_rails3_routes to 1.0.4

fixes CNVS-7379

test plan:
1. Log in as a student who has taken quizzes and has had assignments graded.
2. On the main and course pages, try to click on an Assignment/ Quiz link under Recent Feedback
3. The links should work without error

Change-Id: I669c057add5fc14df891608054a997b33939fd0c
Reviewed-on: https://gerrit.instructure.com/23242
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fix permissions on imported announcements.

fixes CNVS-7467

test plan:
  * create an announcement without a user ID (by running
    DiscussionTopic.update_all('user_id = NULL', id: ID)
    where 'ID' is the ID of the announcement;
  * without logging in, navigate to the announcement's url;
  * verify that you are asked to log in;
  * make the course public and verify that the announcement
    is visible without a log in.

Change-Id: I79062535da8266384bb32c43732c7f25b0036675
Reviewed-on: https://gerrit.instructure.com/23227
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
Updated es translation
Updated ar translation