diff --git a/cms/static/js/base.js b/cms/static/js/base.js index e485f435a5..d312815a32 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -21,13 +21,12 @@ $(document).ready(function() { $('.unit-history ol a').bind('click', showHistoryModal); $modal.bind('click', hideModal); $modalCover.bind('click', hideHistoryModal); + $modalCover.bind('click', hideModal); $('.assets .upload-button').bind('click', showUploadModal); $('.upload-modal .close-button').bind('click', hideModal); - $('a.show-xml').toggle(showEmbeddableXML, hideEmbeddableXML); $('.embeddable-xml-input').bind('click', function(){ $(this).select(); }); - $('a.copy-button').toggle(showEmbeddableXML, hideEmbeddableXML); $('.unit .item-actions .delete-button').bind('click', deleteUnit); $('.new-unit-item').bind('click', createNewUnit); $('.save-subsection').bind('click', saveSubsection); @@ -119,18 +118,6 @@ function removePolicyMetadata(e) { _parent_el.appendTo("#policy-to-delete"); } -function showEmbeddableXML(e) { - $ceiling = $(this).parents('tr'); - if ($ceiling.length === 0) $ceiling = $(this).parents('.upload-modal'); - $ceiling.find('.embeddable-xml').html('<img src="'+$(this).attr('href')+'"/>'); -} -function hideEmbeddableXML(e) { - $ceiling = $(this).parents('tr'); - console.log($ceiling.length) - if ($ceiling.length === 0) $ceiling = $(this).parents('.upload-modal'); - $ceiling.find('.embeddable-xml').html(""); -} - // This method only changes the ordering of the child objects in a subsection function onUnitReordered() { @@ -342,8 +329,11 @@ function displayFinishedUpload(xhr) { if(xhr.status = 200){ markAsLoaded(); } + var resp = JSON.parse(xhr.responseText); - $('.upload-modal .copy-button').attr('href', xhr.getResponseHeader('asset_url')); + $('.upload-modal .embeddable-xml-input').val(''); + $('.upload-modal .embeddable').show(); + $('.upload-modal .file-name').hide(); $('.upload-modal .progress-fill').html(resp.msg); $('.upload-modal .choose-file-button').html('Load Another File').show(); $('.upload-modal .progress-fill').width('100%'); diff --git a/cms/static/sass/_assets.scss b/cms/static/sass/_assets.scss index feb99b5737..7cfeea390b 100644 --- a/cms/static/sass/_assets.scss +++ b/cms/static/sass/_assets.scss @@ -47,6 +47,10 @@ } } + .name-col { + font-size: 14px; + } + .date-col { font-size: 12px; } @@ -165,6 +169,21 @@ text-align: center; } + .embeddable { + display: none; + margin: 30px 0 130px; + + label { + display: block; + margin-bottom: 10px; + font-weight: 700; + } + } + + .embeddable-xml-input { + width: 400px; + } + .copy-button { @include white-button; display: none; diff --git a/cms/templates/asset_index.html b/cms/templates/asset_index.html index 82304dcb57..6780403866 100644 --- a/cms/templates/asset_index.html +++ b/cms/templates/asset_index.html @@ -97,8 +97,10 @@
-
- Show Embeddable XML +
+ + '> +
Choose File