Commit 940273beb45beeb2634f1c01c37148e8a9bd02a9

Authored by Álvaro Fernando Matos de Souza
1 parent 37dd71d9

Removing unnecessary html class and adapting JS

Removing animations from plugin and unecessary classes

Signed-off-by: Álvaro Fernando <alvarofernandoms@gmail.com>
Signed-off-by: ArthurJahn <stutrzbecher@gmail.com>
public/lib/software-catalog-component.js
@@ -3,39 +3,7 @@ modulejs.define(&#39;SoftwareCatalogComponent&#39;, [&#39;jquery&#39;], function($) { @@ -3,39 +3,7 @@ modulejs.define(&#39;SoftwareCatalogComponent&#39;, [&#39;jquery&#39;], function($) {
3 3
4 var dispatch_ajax_function; 4 var dispatch_ajax_function;
5 5
6 -  
7 - function show_head_message() {  
8 - if ($("#filter-categories-select-catalog").text().length === 0){  
9 - $("#filter-categories-select-catalog").hide();  
10 - $("#filter-option-catalog-software").show();  
11 - }else{  
12 - $("#filter-categories-select-catalog").show();  
13 - $("#filter-option-catalog-software").hide();  
14 - }  
15 - }  
16 -  
17 -  
18 - function slideDowsCategoriesOptionAndHideOptionCatalog() {  
19 - $("#filter-categories-option").slideDown();  
20 - $("#filter-option-catalog-software").hide();  
21 - }  
22 -  
23 -  
24 - function slideDownCategoriesOptionAndHideCategoriesSelect() {  
25 - $("#filter-categories-option").slideDown();  
26 - $("#filter-categories-select-catalog").hide();  
27 - }  
28 -  
29 -  
30 - function slideUpCategoriesAndShowHeadMessage() {  
31 - $("#filter-categories-option").slideUp();  
32 - show_head_message();  
33 - }  
34 -  
35 -  
36 function clearCatalogCheckbox() { 6 function clearCatalogCheckbox() {
37 - $("#filter-categories-option").slideUp();  
38 - $("#filter-option-catalog-software").show();  
39 $("#group-categories input:checked").each(function() { 7 $("#group-categories input:checked").each(function() {
40 $(this).prop('checked', false); 8 $(this).prop('checked', false);
41 }); 9 });
@@ -45,39 +13,26 @@ modulejs.define(&#39;SoftwareCatalogComponent&#39;, [&#39;jquery&#39;], function($) { @@ -45,39 +13,26 @@ modulejs.define(&#39;SoftwareCatalogComponent&#39;, [&#39;jquery&#39;], function($) {
45 13
46 14
47 function selectCheckboxCategory(dispatch_ajax) { 15 function selectCheckboxCategory(dispatch_ajax) {
48 - $("#filter-categories-option").slideUp();  
49 - $("#filter-categories-select-catalog").show();  
50 - $("#filter-option-catalog-software").hide();  
51 -  
52 dispatch_ajax_function(true); 16 dispatch_ajax_function(true);
53 } 17 }
54 18
55 19
56 function selectProjectSoftwareCheckbox() { 20 function selectProjectSoftwareCheckbox() {
57 - $("#filter-categories-option").slideUp();  
58 - $("#filter-categories-select-catalog").show();  
59 - $("#filter-option-catalog-software").hide();  
60 -  
61 dispatch_ajax_function(true); 21 dispatch_ajax_function(true);
62 - show_head_message();  
63 } 22 }
64 23
65 24
66 function set_events() { 25 function set_events() {
67 - $("#filter-option-catalog-software").click(slideDowsCategoriesOptionAndHideOptionCatalog);  
68 - $("#filter-categories-select-catalog").click(slideDownCategoriesOptionAndHideCategoriesSelect);  
69 - $("#close-filter-catalog").click(slideUpCategoriesAndShowHeadMessage);  
70 $("#cleanup-filter-catalg").click(clearCatalogCheckbox); 26 $("#cleanup-filter-catalg").click(clearCatalogCheckbox);
71 $(".categories-catalog").click(selectCheckboxCategory); 27 $(".categories-catalog").click(selectCheckboxCategory);
72 $(".project-software").click(selectProjectSoftwareCheckbox); 28 $(".project-software").click(selectProjectSoftwareCheckbox);
73 } 29 }
74 30
75 -  
76 return { 31 return {
77 init: function(dispatch_ajax) { 32 init: function(dispatch_ajax) {
78 dispatch_ajax_function = dispatch_ajax; 33 dispatch_ajax_function = dispatch_ajax;
79 set_events(); 34 set_events();
80 - show_head_message();  
81 }, 35 },
82 } 36 }
83 }); 37 });
  38 +
public/views/search-software-catalog.js
@@ -161,10 +161,8 @@ modulejs.define(&#39;SearchSoftwareCatalog&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SoftwareCat @@ -161,10 +161,8 @@ modulejs.define(&#39;SearchSoftwareCatalog&#39;, [&#39;jquery&#39;, &#39;NoosferoRoot&#39;, &#39;SoftwareCat
161 init: function() { 161 init: function() {
162 set_events(); 162 set_events();
163 catalog_message(); 163 catalog_message();
164 -  
165 - $("#filter-categories-option").hide();  
166 -  
167 SoftwareCatalogComponent.init(dispatch_search_ajax); 164 SoftwareCatalogComponent.init(dispatch_search_ajax);
168 } 165 }
169 } 166 }
170 -});  
171 \ No newline at end of file 167 \ No newline at end of file
  168 +});
  169 +
views/search/_catalog_filter.html.erb
1 <div id="filter-catalog-software"> 1 <div id="filter-catalog-software">
2 2
3 - <div id="filter-option-catalog-software"><%= _("More options") %></div>  
4 - <!--Quando tiver filtros(categorias)selecionados mostrar esta opção: Opções selecionadas-->  
5 -  
6 - <div id="filter-categories-select-catalog"><%= @message_selected_options %></div>  
7 -  
8 <div id="filter-categories-option"> 3 <div id="filter-categories-option">
9 -  
10 <div id="filter-categories-catalog"><h4> <%= _("Categories") %> </h4></div> 4 <div id="filter-categories-catalog"><h4> <%= _("Categories") %> </h4></div>
11 - <div id="group-categories">  
12 - <ul>  
13 - <% @categories_groupe_one.each do |category| %>  
14 - <li>  
15 - <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %>  
16 - <span><%= _("#{category.name}") %></span>  
17 - </li>  
18 - <% end %>  
19 - <% @categories_groupe_two.each do |category| %>  
20 - <li>  
21 - <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %>  
22 - <%= _("#{category.name}") %>  
23 - </li>  
24 - <% end %>  
25 - </ul>  
26 - </div> 5 + <div id="group-categories">
  6 + <ul>
  7 + <% @categories_groupe_one.each do |category| %>
  8 + <li>
  9 + <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %>
  10 + <span><%= _("#{category.name}") %></span>
  11 + </li>
  12 + <% end %>
  13 + <% @categories_groupe_two.each do |category| %>
  14 + <li>
  15 + <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %>
  16 + <%= _("#{category.name}") %>
  17 + </li>
  18 + <% end %>
  19 + </ul>
  20 + </div>
27 21
28 <div class="project-software"> <%= _("Software Projects:") %> 22 <div class="project-software"> <%= _("Software Projects:") %>
29 <label> 23 <label>
@@ -32,7 +26,9 @@ @@ -32,7 +26,9 @@
32 </label> 26 </label>
33 <span class="doubts-catalog-software" title="<%= _('Include software development projects that are not yet officially Brazilian Public Software.') %>">?</span> 27 <span class="doubts-catalog-software" title="<%= _('Include software development projects that are not yet officially Brazilian Public Software.') %>">?</span>
34 </div> 28 </div>
  29 + </div>
  30 + <div id="filter-option-catalog-software"><%= _("More options") %></div>
  31 + <div id="filter-option-catalog-close">
35 <%= button_tag _("Clean up"), :id => "cleanup-filter-catalg", :type => "button" %> 32 <%= button_tag _("Clean up"), :id => "cleanup-filter-catalg", :type => "button" %>
36 <%= button_tag _("Close"), :id => "close-filter-catalog", :type => "button" %> 33 <%= button_tag _("Close"), :id => "close-filter-catalog", :type => "button" %>
37 </div> 34 </div>
38 -  
views/search/_catalog_result_list.html.erb
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 15
16 <% display = display_filter(name, params[:display]) %> 16 <% display = display_filter(name, params[:display]) %>
17 17
18 - <div class="search-results-innerbox search-results-type-<%= name.to_s.singularize %> <%= 'common-profile-list-block' if SearchHelper::COMMON_PROFILE_LIST_BLOCK.include?(name) %>"> 18 + <div class="search-results-innerbox <%= 'common-profile-list-block' if SearchHelper::COMMON_PROFILE_LIST_BLOCK.include?(name) %>">
19 <ul> 19 <ul>
20 <% search[:results].each do |hit| %> 20 <% search[:results].each do |hit| %>
21 <% partial = partial_for_class(hit.class, display) %> 21 <% partial = partial_for_class(hit.class, display) %>