1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-22 11:39:03 +01:00

Tune document details in Legalpad

Summary:
Fixes T9245. These picked up some possibly-confusing metadata, like in the screenshot on T9245 where "Subscribers" appears in the middle of the page for no obvious reason.

  - Make these pages a little cleaner by removing elements which aren't important for signing agreements.
  - Use the last time the actual document text was updated as the modification time, not the last time the "Document" object was modified. The latter will change for trivial things like altering the view/edit policy, but that could be confusing if you see that a TOS was "last updated yesterday" but can't figure out what actually changed (since nothing changed).

Test Plan: Viewed signature page for a document.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9245

Differential Revision: https://secure.phabricator.com/D13982
This commit is contained in:
epriestley 2015-08-23 08:31:47 -07:00
parent 5caeb5c4db
commit 459e0d2fa3

View file

@ -234,11 +234,19 @@ final class LegalpadDocumentSignController extends LegalpadController {
$document,
PhabricatorPolicyCapability::CAN_EDIT);
// Use the last content update as the modified date. We don't want to
// show that a document like a TOS was "updated" by an incidental change
// to a field like the preamble or privacy settings which does not acutally
// affect the content of the agreement.
$content_updated = $document_body->getDateCreated();
// NOTE: We're avoiding `setPolicyObject()` here so we don't pick up
// extra UI elements that are unnecessary and clutter the signature page.
// These details are available on the "Manage" page.
$header = id(new PHUIHeaderView())
->setHeader($title)
->setUser($viewer)
->setPolicyObject($document)
->setEpoch($document->getDateModified())
->setEpoch($content_updated)
->addActionLink(
id(new PHUIButtonView())
->setTag('a')
@ -258,15 +266,16 @@ final class LegalpadDocumentSignController extends LegalpadController {
'default',
$viewer);
// NOTE: We're avoiding `setObject()` here so we don't pick up extra UI
// elements like "Subscribers". This information is available on the
// "Manage" page, but just clutters up the "Signature" page.
$preamble = id(new PHUIPropertyListView())
->setUser($viewer)
->setObject($document)
->addSectionHeader(pht('Preamble'))
->addTextContent($preamble_text);
$preamble_box = new PHUIPropertyGroupView();
$preamble_box->addPropertyList($preamble);
}
$content = id(new PHUIDocumentView())