diff --git a/src/noosfero-spb/software_communities/public/blocks/software-download.js b/src/noosfero-spb/software_communities/public/blocks/software-download.js index b177e34..c6e9d7c 100644 --- a/src/noosfero-spb/software_communities/public/blocks/software-download.js +++ b/src/noosfero-spb/software_communities/public/blocks/software-download.js @@ -16,10 +16,16 @@ modulejs.define('SoftwareDownload', ['jquery', 'NoosferoRoot'], function($, Noos var download_option = $(element).find('.file-size').closest('.download-option'); download_option.find('#block_downloads__link').val(path); download_option.find('#block_downloads__size').val(size); + + var fileElements = $(element).parent().parent().find('.file-item'); + for (var i = 0; i < fileElements.length; i++) { + fileElements[i].classList.remove('selected'); + } + $(element).parent()[0].classList.add('selected'); } - SoftwareDownload.prototype.toggleFiles = function(element) { - var files_ul = $(element).parent().find('ul')[0]; + SoftwareDownload.prototype.toggleForm = function(element) { + var files_ul = $(element).parent().find('.toggle-form')[0]; files_ul.classList.toggle('opened'); files_ul.classList.toggle('closed'); } diff --git a/src/noosfero-spb/software_communities/public/style.css b/src/noosfero-spb/software_communities/public/style.css index 2dc4c5f..e8f712b 100644 --- a/src/noosfero-spb/software_communities/public/style.css +++ b/src/noosfero-spb/software_communities/public/style.css @@ -118,11 +118,43 @@ margin-top: 5px; } +/* profile_design download block */ + #droppable-list-downloads .download-forms{ margin-bottom: 20px; margin-left: 0; } +#edit-download-block ul.link-list-header{ + display: none; +} + +#edit-download-block{ + margin-top: 10px; + width: 450px; +} + +.download-forms { + position: relative; +} + +.download-forms .toggle-form { + transition: all ease .35s; + overflow: hidden; +} + +.download-forms .toggle-form.closed { + height: 0px; +} + +.download-forms .toggle-form.opened { + height: auto; +} + +.download-forms .toggle-form ul { + background: #DEDEDE; +} + .download-forms ul li{ margin-bottom: 10px; } @@ -132,27 +164,27 @@ margin-bottom: 5px; } -#edit-download-block ul.link-list-header{ - display: none; +.download-forms .formfieldline input[type="text"] { + width: 380px; } -#edit-download-block{ - margin-top: 10px; +.download-forms .file-item { + cursor: pointer; + line-height: 30px; } -.download-option .files ul { - width: 450px; +.download-forms .file-item.selected { + font-weight: bold; background: #9E9E9E; - transition: height ease .35s; - overflow: scroll; } - -.download-option ul.closed { - height: 0px; +.download-forms a.icon-edit { + position: absolute; + right: 0; + top: 20px; + background-position: left; + padding: 3px 5px 3px 15px; } - -.download-option ul.opened { - height: 70px; +.download-forms a.icon-edit span { + display: inline; } - /* end of profile_design download block */ diff --git a/src/noosfero-spb/software_communities/views/box_organizer/_download_file.html.erb b/src/noosfero-spb/software_communities/views/box_organizer/_download_file.html.erb index 17e3b17..fc75341 100644 --- a/src/noosfero-spb/software_communities/views/box_organizer/_download_file.html.erb +++ b/src/noosfero-spb/software_communities/views/box_organizer/_download_file.html.erb @@ -1,5 +1,5 @@ -