Allow `AphrontTagView` subclasses to wrap their tag in a container

Summary: See Conpherence discussion. This probably works?

Test Plan:
Didn't test at all!

bwahaha

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6120
Conpherence - implement epoch creation slightly differently

Summary: D6114 fixed some bugs but on production it shows up as a new bug where Saturday is the first day? stop messing with the DateTime object so much and do some old school epoch manipulation. This works correctly on my laptop and my still fail in production, but it will rule out DateTime suckage.

Test Plan: still works on laptop

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6115
Prompt to adding a project if none in Maniphest

Summary: Adds 'Add Project...' if no projects present on Maniphest items. Also - I can't seem to get a dialog to pop, what am I missing? Fixes T3308

Test Plan: Click add project, get edit form.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3308

Differential Revision: https://secure.phabricator.com/D6121
Add a book controller and various amenities to Diviner's live view

Summary: Ref T988. Mostly backend changes, with a very rough frontend on top of them. See Conpherence discussion.

Test Plan: {F45010}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T988

Differential Revision: https://secure.phabricator.com/D6113
Fix some Phabricator lint warnings

Summary: Lint.

Test Plan: Lint.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6127
Mostly generalize Maniphest's drag-and-drop list

Summary:
I want to use draggable lists in at least three other interfaces:

  - (Today) Reorganizing named search queries.
  - (Today) Reorganizing custom fields.
  - (Future) Dragging tasks around on boards.

This mostly generalizes the drag-and-drop code in Maniphest's task list. It isn't a total generalization and will need some more tweaking (for example, Maniphest's list is unusual in that the user can't drag items to the top of the list), but it substantially separates the Maniphest-specific behaviors from the general dragging behaviors.

This diff causes no functional changes.

Test Plan: Dragged and dropped tasks in Maniphest.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6124
Allow builtin named queries to be disabled

Summary:
Applications come with builtin queries, but users might want to get rid of them. Allow users to disable named queries if they prefer.

This has one funky behavior, which is that the first time you disable a named query it goes to the top of your list. That will be fixed in the next diff, which will make them reorderable.

Test Plan: Added/edited/removed named queries, disabled/enabled builtin named queries.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6128
Globally limit the size of generated emails.

Summary: At the global level, truncate emails at a user-configured size.

Test Plan: Untested, as I could not get PHP to send emails on my box, but if you can this should be very easy to test. Just set the max size to something like .001 kilobytes and make sure it does the right thing.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, AnhNhan

Maniphest Tasks: T1392

Differential Revision: https://secure.phabricator.com/D6118
PHUIList, PHUIDocument updates

Summary:
This diff covers a bit of ground.

- PHUIDocumentExample has been added
- PHUIDocument has been extended with new features
- PhabricatorMenuView is now PHUIListView
- PhabricatorMenuItemView is now PHUIItemListView

Overall - I think I've gotten all the edges covered here. There is some derpi-ness that we can talk about, comments in the code. Responsive design is missing from the new features on PHUIDocument, will follow up later.

Test Plan: Tested mobile and desktop menus, old phriction layout, new document views, new lists, and object lists.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6130
Allow "Description" and "Assigned To" to be prefilled in Maniphest's create task interface

Summary:
Ref T3320. Request from Dropbox. You can currently prefill "title" and some other stuff (including most of the fields by using templates) but there's no way to prefill description and assigned to right now.

  - Allow "Description" to be prefilled with a string ("description=...").
  - Allow "Assigned To" to be prefilled with a user rather than a PHID ("assign=username").

Test Plan:
Hit `/maniphest/task/create/?assign=epriestley&description=derpderp&title=blarpblarp` locally and got prefills.

{F45259}

Reviewers: chad, deuresti

Reviewed By: chad

CC: aran, euresti

Maniphest Tasks: T3320

Differential Revision: https://secure.phabricator.com/D6132
Fix a bug where PhabricatorPasteQuery incorrectly rekeys results

Summary: I made changes here recently to improve robustness in the presence of missing files, but accidentally caused the results to re-key. Some callers depend on the mapping, and every other query is consistent about it. Restore the original behavior.

Test Plan: `Pnnn` works again in remarkup.

Reviewers: dctrwatson, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6134
Fix typo in typehint
PHUIListView Examples, CSS

Summary: This adds examples and abstracts out CSS for common nav re-use.

Test Plan: Tested DocumentExample and ListExample

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6138
Generalize rules for "workflow" sigil

Summary:
See discussion in D6130. Basically, all of these should activate workflow:

  <a data-sigil="workflow" href="...">...</a>

  <div data-sigil="workflow">
    <a href="...">...</a>
  </div>

  <form data-sigil="workflow" action="...">...</form>

  <div data-sigil="workflow">
    <form action="...">...</form>
  </div>

The only case where we don't want to activate workflow is this one:

  <form data-sigil="workflow">
    <a href="...">...</a>
  </form>

Here, the form should workflow but the `<a />` should not.

These cases aren't really covered:

  // Undefined no matter where "workflow" is because it's nonsense.
  <a><a>...</a></a>

  // As above except like a million times more dumb.
  <form><form>...</form></form>

  // This one is ambiguous. The <a /> will currently workflow. We don't do
  // this anywhere and probably never will. If we want a different rule we
  // can cross that bridge when we come to it.
  <div data-sigil="workflow">
    <form action="...">
      <a href="...">...</a>
    </form>
  </div>

Test Plan: Clicked/submitted some things with workflow.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6131
Remove all the container node stuff from AphrontTagView

Summary: See discussion in D6131, D6130. This turned into 35 layers of mess so throw it away and just tweak the JS to be more flexible.

Test Plan:
  - Clicked "Show More Applications".
  - Clicked "Show Fewer Applications".
  - Edited tasks using popup dialog.
  - Tried to drag tasks using pencil icon (correctly no longer works).
  - Changed threads in Conpherence.
  - Not sure how to actually hit the Conpherence "Load ... Threads" thing since
    it seems to auto-load? But that works, at least, and the code doesn't really
    care what you hit.
  - Added a conpherence participant.
  - Added a new calendar item.
  - Poked around other menus.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6133
Allow named queries to be reordered by dragging

Summary:
Also you have to drop them. So drag, and then drop.

This needs some cleanup and reconciliation/generalization with the Maniphest implementation. In particular, you can't drag things to the very top right now, and they should share more CSS and more behaviors.

Test Plan:
Look I alphabetized them:

{F45286}

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6136
Restrict icon hover on lists to sidebar.

Summary: Needed to be more restrictive

Test Plan: Test maniphest and list examples.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6139
Simplify drag-and-drop list implementations

Summary:
  - Use the same styles for shared operations (`drag-ghost`, `drag-dragging`).
  - Move shared code into the base class.

Test Plan: Dragged around tasks and named queries.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6141
Default application search to the topmost filter

Summary: Allow users to set a default by dragging it to the top. When they land on a page without a saved query, choose their default.

Test Plan: Hit `/paste/`, got my default results, etc.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6140
Lots of Icons

Summary: Tweaks the dark, grey, and white icons to match the action-icons. Also added a home icon for navigation.

Test Plan: looked at list navs, action menus.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

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