From edacd22c16c42ababfe849886ee631865b90094b Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Wed, 17 Oct 2012 14:40:37 -0400 Subject: [PATCH 1/4] added xml embed text field to table --- cms/static/js/base.js | 1 + cms/static/sass/_assets.scss | 13 +++++++++++-- cms/templates/asset_index.html | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cms/static/js/base.js b/cms/static/js/base.js index dd9065dd07..e485f435a5 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -25,6 +25,7 @@ $(document).ready(function() { $('.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); diff --git a/cms/static/sass/_assets.scss b/cms/static/sass/_assets.scss index 136b03280d..feb99b5737 100644 --- a/cms/static/sass/_assets.scss +++ b/cms/static/sass/_assets.scss @@ -9,6 +9,7 @@ @include blue-button; float: left; margin-right: 20px; + padding: 8px 30px 10px; font-size: 12px; } @@ -45,6 +46,10 @@ border-top: none; } } + + .date-col { + font-size: 12px; + } } .thumb-col { @@ -52,11 +57,15 @@ } .date-col { - width: 200px; + width: 220px; } .embed-col { - width: 70px; + width: 250px; + } + + .embeddable-xml-input { + width: 100%; } .thumb { diff --git a/cms/templates/asset_index.html b/cms/templates/asset_index.html index 4244bd2542..82304dcb57 100644 --- a/cms/templates/asset_index.html +++ b/cms/templates/asset_index.html @@ -68,7 +68,7 @@ ${asset['uploadDate']} - XML + '> % endfor From e9b42d7a15343dc05d379285ae28f91f8bb19fd8 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Wed, 17 Oct 2012 15:07:34 -0400 Subject: [PATCH 2/4] added embeddable xml input text to modal --- cms/static/js/base.js | 20 +++++--------------- cms/static/sass/_assets.scss | 19 +++++++++++++++++++ cms/templates/asset_index.html | 6 ++++-- 3 files changed, 28 insertions(+), 17 deletions(-) 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 From a91a19e7a808d1fec1f657670e00321e185451ed Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Wed, 17 Oct 2012 15:12:50 -0400 Subject: [PATCH 3/4] adjustments for newly inserted assets --- cms/static/js/base.js | 2 +- cms/templates/asset_index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cms/static/js/base.js b/cms/static/js/base.js index d312815a32..0bcf97c04f 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -25,7 +25,7 @@ $(document).ready(function() { $('.assets .upload-button').bind('click', showUploadModal); $('.upload-modal .close-button').bind('click', hideModal); - $('.embeddable-xml-input').bind('click', function(){ $(this).select(); }); + $body.on('click', '.embeddable-xml-input', function(){ $(this).select(); }); $('.unit .item-actions .delete-button').bind('click', deleteUnit); $('.new-unit-item').bind('click', createNewUnit); diff --git a/cms/templates/asset_index.html b/cms/templates/asset_index.html index 6780403866..53b4c6d71a 100644 --- a/cms/templates/asset_index.html +++ b/cms/templates/asset_index.html @@ -28,7 +28,7 @@ {{uploadDate}} - XML + From 005cf66e2e2e5ce909bcdc83f2007037c6914e01 Mon Sep 17 00:00:00 2001 From: Tom Giannattasio Date: Wed, 17 Oct 2012 15:20:03 -0400 Subject: [PATCH 4/4] removed box shadow on embed xmls --- cms/static/sass/_assets.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cms/static/sass/_assets.scss b/cms/static/sass/_assets.scss index 7cfeea390b..29c3d4000d 100644 --- a/cms/static/sass/_assets.scss +++ b/cms/static/sass/_assets.scss @@ -69,6 +69,7 @@ } .embeddable-xml-input { + @include box-shadow(none); width: 100%; } @@ -180,7 +181,8 @@ } } - .embeddable-xml-input { + .embeddable-xml-input { + @include box-shadow(none); width: 400px; }