diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -40,7 +40,7 @@ 'rsrc/css/application/calendar/calendar-icon.css' => 'c69aa59f', 'rsrc/css/application/chatlog/chatlog.css' => 'd295b020', 'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4', - 'rsrc/css/application/config/config-options.css' => '7fedf08b', + 'rsrc/css/application/config/config-options.css' => '0a343249', 'rsrc/css/application/config/config-template.css' => '8e6c6fcd', 'rsrc/css/application/config/config-welcome.css' => '6abd79be', 'rsrc/css/application/config/setup-issue.css' => 'db7e9c40', @@ -505,7 +505,7 @@ 'calendar-icon-css' => 'c69aa59f', 'changeset-view-manager' => '58562350', 'conduit-api-css' => '7bc725c4', - 'config-options-css' => '7fedf08b', + 'config-options-css' => '0a343249', 'config-welcome-css' => '6abd79be', 'conpherence-durable-column-view' => '86396117', 'conpherence-menu-css' => 'f99fee4c', diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -122,7 +122,7 @@ ->appendChild(phutil_tag('p', array(), $msg)); } - if ($option->getHidden()) { + if ($option->getHidden() || $option->getLocked()) { $control = null; } else { $control = $this->renderControl( @@ -164,14 +164,20 @@ $form ->appendChild($control); - $submit_control = id(new AphrontFormSubmitControl()) - ->addCancelButton($done_uri); if (!$option->getLocked()) { - $submit_control->setValue(pht('Save Config Entry')); + $form->appendChild( + id(new AphrontFormSubmitControl()) + ->addCancelButton($done_uri) + ->setValue(pht('Save Config Entry'))); } - $form->appendChild($submit_control); + if (!$option->getHidden()) { + $form->appendChild( + id(new AphrontFormMarkupControl()) + ->setLabel(pht('Current Configuration')) + ->setValue($this->renderDefaults($option, $config_entry))); + } $examples = $this->renderExamples($option); if ($examples) { @@ -181,13 +187,6 @@ ->setValue($examples)); } - if (!$option->getHidden()) { - $form->appendChild( - id(new AphrontFormMarkupControl()) - ->setLabel(pht('Default')) - ->setValue($this->renderDefaults($option, $config_entry))); - } - $title = pht('Edit %s', $key); $short = pht('Edit'); @@ -438,16 +437,12 @@ } $control - ->setLabel(pht('Value')) + ->setLabel(pht('Database Value')) ->setError($e_value) ->setValue($display_value) ->setName('value'); } - if ($option->getLocked()) { - $control->setDisabled(true); - } - return $control; } @@ -501,25 +496,41 @@ phutil_tag('th', array(), pht('Source')), phutil_tag('th', array(), pht('Value')), )); + + $is_effective_value = true; foreach ($stack as $key => $source) { + $row_classes = array( + 'column-labels', + ); + $value = $source->getKeys( array( $option->getKey(), )); if (!array_key_exists($option->getKey(), $value)) { - $value = phutil_tag('em', array(), pht('(empty)')); + $value = phutil_tag('em', array(), pht('(No Value Configured)')); } else { $value = $this->getDisplayValue( $option, $entry, $value[$option->getKey()]); + + if ($is_effective_value) { + $is_effective_value = false; + $row_classes[] = 'config-options-effective-value'; + } } - $table[] = phutil_tag('tr', array('class' => 'column-labels'), array( - phutil_tag('th', array(), $source->getName()), - phutil_tag('td', array(), $value), - )); + $table[] = phutil_tag( + 'tr', + array( + 'class' => implode(' ', $row_classes), + ), + array( + phutil_tag('th', array(), $source->getName()), + phutil_tag('td', array(), $value), + )); } require_celerity_resource('config-options-css'); diff --git a/src/applications/config/option/PhabricatorConfigOption.php b/src/applications/config/option/PhabricatorConfigOption.php --- a/src/applications/config/option/PhabricatorConfigOption.php +++ b/src/applications/config/option/PhabricatorConfigOption.php @@ -76,9 +76,9 @@ } return pht( 'This configuration is locked and can not be edited from the web '. - 'interface. Use `%s` in `%s` to edit it.', - './bin/config', - 'phabricator/'); + 'interface. Use %s in %s to edit it.', + phutil_tag('tt', array(), './bin/config'), + phutil_tag('tt', array(), 'phabricator/')); } public function addExample($value, $description) { diff --git a/webroot/rsrc/css/application/config/config-options.css b/webroot/rsrc/css/application/config/config-options.css --- a/webroot/rsrc/css/application/config/config-options.css +++ b/webroot/rsrc/css/application/config/config-options.css @@ -49,3 +49,8 @@ .config-options-current-value span { color: {$greytext}; } + +.config-options-effective-value, +.config-option-table .config-options-effective-value th { + background: {$lightyellow}; +}