Commit c7e7ae60 authored by Leigh Stoller's avatar Leigh Stoller

Do not show download button when creating a new profile.

parent b28a65cb
......@@ -227,17 +227,21 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, aptforms,
// is no script.
//
var source = $.trim($('#profile_script_textarea').val());
var href = "show-profile.php?uuid=" + profile_uuid;
var type = "source";
if (!source.length) {
source = $.trim($('#profile_rspec_textarea').val());
$('#rspec_modal_download_button')
.attr("href", href + "&rspec=true");
type = "rspec";
}
else {
if (profile_uuid) {
$('#rspec_modal_download_button')
.attr("href", href + "&source=true");
.attr("href",
"show-profile.php?uuid=" + profile_uuid +
"&" + type + "=true");
}
else {
$('#rspec_modal_download_button').addClass("hidden");
}
$('#rspec_modal_upload_span').removeClass("hidden");
$('#rspec_modal_editbuttons').removeClass("hidden");
$('#rspec_modal_viewbuttons').addClass("hidden");
......@@ -254,10 +258,16 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, aptforms,
// XML, but it is not intended to be edited.
//
var source = $.trim($('#profile_rspec_textarea').val());
var href = "show-profile.php?uuid=" + profile_uuid +
"&rspec=true";
$('#rspec_modal_download_button')
.attr("href", href + "&rspec=true");
if (profile_uuid) {
$('#rspec_modal_download_button')
.attr("href",
"show-profile.php?uuid=" + profile_uuid +
"&rspec=true");
}
else {
$('#rspec_modal_download_button').addClass("hidden");
}
$('#rspec_modal_upload_span').addClass("hidden");
$('#rspec_modal_editbuttons').addClass("hidden");
$('#rspec_modal_viewbuttons').removeClass("hidden");
......
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