Use delegation to generalize application search controllers

Summary:
Ref T2625. Lifts almost all of the search logic out of Paste controllers and into Search.

This uses controller delegation for generalization. We use this in a few places, but don't use it very much yet. I think it's pretty reasonable as-is, but I might be able to make even more stuff free.

There are some slightly rough edges around routes, still, but I want to hit Phame and Differential (which both have multiple application search engines) before trying to generalize that.

Test Plan: Executed, browsed and managed Paste searches.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2625

Differential Revision: https://secure.phabricator.com/D6073
Implement generalized application search in Macros

Summary: Ref T2625. Works out the last kinks of generalization and gives Macros the more powerful new query engine. Overall, this feels pretty good to me.

Test Plan: Executed, saved and edited a bunch of Macro queries.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2625

Differential Revision: https://secure.phabricator.com/D6078
Conpherence - add daily date dividers

Summary: nice title. Fixes T3203. If its been N days and now its Tuesday, it just shows a single marker for Tuesday.

Test Plan: Viewed a conpherence and there were date dividers!

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3203

Differential Revision: https://secure.phabricator.com/D6081
Allow datetime inputs to be optional

Summary:
Fixes T3279. For ApplicationSearch (and in some other cases) I'd like users to be able to provide an optional date. This isn't currently possible.

Add a checkbox which disables or enables the input.

Test Plan: Used UIExample to enter dates. Used Calendar to enter dates.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T3279

Differential Revision: https://secure.phabricator.com/D6082
Conpherence - add createthread method

Summary: Ref T3166. I moved the create logic into a static method in the editor class to keep things tidy.

Test Plan: created a conpherence from UI. purdy. tried errors and got UI to show "required". for conduit, created a thread with all the bells and whistles and it worked. verified i got proper exceptions with bum conduit calls

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T3166

Differential Revision: https://secure.phabricator.com/D6083
Store hash of session key

Summary:
This prevents security by obscurity.
If I have read-only access to the database then I can pretend to be any logged-in user.

I've used `PhabricatorHash::digest()` (even though we don't need salt as the hashed string is random) to be compatible with user log.

Test Plan:
Applied patch.
Verified I'm still logged in.
Logged out.
Logged in.

  $ arc tasks

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6080
Add a date range query to Macros

Summary:
Ref T1163. Ref T2625. This could probably use some tweaks, but I kept things mostly-generic.

I added a new control for freeform dates so we can have it render help or whatever later on.

Test Plan: See screenshots.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2625, T1163

Differential Revision: https://secure.phabricator.com/D6084
Reference task based on branch name in `arc diff`

Summary:
This was mentioned in T2928 and nobody objected.
It just references the task instead of fixing it as that would be too aggressive.
It also doesn't check assignee of the task (by purpose).

Test Plan: Created diff from a branch named T2928.

Reviewers: epriestley, edward

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2928

Differential Revision: https://secure.phabricator.com/D5640
Add language and date ranges to Paste queries

Summary:
Ref T2625. Ref T3273. This is mostly a UI foil for T3273. Right now, to find tasks without owners or without projects you search for the magic strings "upforgrabs" and "noproject". Unsurprisingly, no users have ever figured this out. I want to get rid of it. Instead, these interfaces will look like:

      Assigned: [ Type a user name... ]
                [ X ] Find unassigned tasks.
      Projects: [ Type a project name... ]
                [ X ] Find tasks with no projects.

Seems reasonable, I think?

Test Plan: Searched for "rainbow, js", "rainbow + no language", "no language", date ranges, etc.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T2625, T3273

Differential Revision: https://secure.phabricator.com/D6085
Allow Maniphest tasks to be edited from the list view

Summary:
Fixes T1945. Ref T2947. At various times, installs (Disqus, Dropbox, etc.) have asked for a way to edit tasks more quickly. Provide edit-from-lists.

{F44700}

{F44701}

The one rough edge on this is that if you change the task priority we update it inline but don't move it. It's probably infeasible to actually move it, but maybe we could give it some sort of visual style to indicate that it's dirty.

Test Plan: Edited tasks normally and via this action thing.

Reviewers: chad, btrahan

Reviewed By: chad

CC: tido, deuresti, ahoffer, aran

Maniphest Tasks: T1945, T2947

Differential Revision: https://secure.phabricator.com/D6086
Let mobile dialogs go full width

Summary: We were clipping this to 300px, which is arbitrary to iPhone.

Test Plan: test on Nexus, iPhone

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6089
Update ObjectItemView to a 4px grid

Summary: Cleaning up the spacing on ObjectItemView to be on a 4px grid and a little more consistent.

Test Plan: Review changes on a grid in Photoshop

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6088
Conpherence - add querythead conduit method

Summary: nice title. also adds a description to the create thread method which I forgot to add...  Ref T3166.

Test Plan: queried threads by ids, by phids, and by offset / limit tweakage. Got the right stuff!

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T3166

Differential Revision: https://secure.phabricator.com/D6096
Improve some search behaviors on mobile/devices

Summary:
Ref T2625.

  - Build the mobile menu from the delegating controller.
  - Make the result header look a little better (still a bit funky).

Test Plan:
{F44774}

{F44775}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2625

Differential Revision: https://secure.phabricator.com/D6090
Implement ApplicationSearch in Files

Summary: Ref T2625. Ref T1163. A couple of small generalization nudges, but this is almost entirely straightforward.

Test Plan: Executed various File queries.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1163, T2625

Differential Revision: https://secure.phabricator.com/D6091
Implement ApplicationSearch in People

Summary:
Ref T2625. Fixes T2812. Implement ApplicationSearch in People.

{F44788}

Test Plan: Made People queries. Used Conduit. Used `@mentions`.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2625, T2812

Differential Revision: https://secure.phabricator.com/D6092
Use ObjectItemListView in Diviner

Summary: Ref T988. Nuke the old directory CSS.

Test Plan: {F44796}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6093
Use ApplicationSearch in Diviner

Summary: Ref T988. Ref T2625. Rough cut of ApplicationSearch in Diviner, for detailed Atom queries. This isn't useful yet, and isn't linked in the UI.

Test Plan: {F44836}

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T988, T2625

Differential Revision: https://secure.phabricator.com/D6094
Conpherence - add querytransaction method

Summary: Ref T3166. Returned all the data I could think of, though notable "metadata" isn't used in conpherence (yet afaik) AND its somewhat silly to return the conpherence id / phid you specified, but seems handy.

Test Plan: played with conduit console.

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Maniphest Tasks: T3166

Differential Revision: https://secure.phabricator.com/D6098
Set untitled Conpherences to '[No Title]' so users change them

Summary: This mainly affects crumbs, makes it more clear that the Conpherence doesn't have a set title.

Test Plan: Clear a title, see [No Title]

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6099