Added instructions to patch submission form.

This commit is contained in:
2013-11-07 20:23:06 +06:00
parent bbe357e5c0
commit 7e874a33fb
4 changed files with 31 additions and 7 deletions

View File

@@ -53,19 +53,27 @@ final class DifferentialDiffCreateController extends DifferentialController {
$cancel_uri = $this->getApplicationURI();
$form
->setAction('/differential/diff/create/')
->setEncType('multipart/form-data')
->setUser($request->getUser())
->appendInstructions(
pht(
if (PhabricatorEnv::getEnvConfig('patch_guidelines.file') !== null) {
$webroot = dirname(phutil_get_library_root('phabricator')).'/webroot/';
$instructions = phutil_safe_html(
FileSystem::readFile($webroot .
PhabricatorEnv::getEnvConfig('patch_guidelines.file')));
} else {
$innstructions = pht(
'The best way to create a Differential diff is by using %s, but you '.
'can also just paste a diff (for example, from %s, %s or %s) into '.
'this box, or upload a diff file.',
$arcanist_link,
phutil_tag('tt', array(), 'svn diff'),
phutil_tag('tt', array(), 'git diff'),
phutil_tag('tt', array(), 'hg diff')))
phutil_tag('tt', array(), 'hg diff'));
}
$form
->setAction('/differential/diff/create/')
->setEncType('multipart/form-data')
->setUser($request->getUser())
->appendInstructions($instructions)
->appendChild(
id(new AphrontFormTextAreaControl())
->setLabel(pht('Raw Diff'))