Commit 804e9862 authored by Leigh B Stoller's avatar Leigh B Stoller

Display public URL.

parent df77cc63
......@@ -65,6 +65,11 @@ function ($, sup)
$('#quickvm_create_profile_form').change(function() {
$('#profile_submit_button').prop('disabled', false);
});
// Auto select the URL if the user clicks in the box.
$('#profile_url').click(function() {
$(this).focus();
$(this).select();
});
}
//
......
......@@ -251,6 +251,14 @@ function SPITFORM($formfields, $errors)
type=checkbox> ".
"List on the public page for anyone to use?</label></div>");
if ($editing) {
$formatter("profile_url", "Public URL",
"<input name=\"formfields[profile_url]\"
id='profile_url' readonly
value='" . $formfields["profile_url"] . "'
class='form-control'
placeholder='' type='text'>");
}
echo " </fieldset>\n";
echo "<div class='form-group'>
......@@ -384,6 +392,7 @@ if (! isset($create)) {
$defaults["profile_name"] = $profile->name();
$defaults["profile_rspec"] = $profile->rspec();
$defaults["profile_created"] = $profile->created();
$defaults["profile_url"] = $profile->url();
$defaults["profile_listed"] =
($profile->listed() ? "checked" : "");
......
......@@ -107,5 +107,16 @@ class Profile
$this->project = null;
return 0;
}
#
# URL.
#
function URL() {
global $APTBASE;
$uuid = $this->uuid();
return "$APTBASE/p/$uuid";
}
}
?>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment