Commit c7c3a74bdd66b767b197bb52b82baadc946756a5

Authored by Arthur Esposte
2 parents efb6aa25 0f2b5571
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Merge branch 'blocks'

Conflicts:
	public/style.css
	views/blocks/search_catalog.html.erb
lib/mpog_software_plugin.rb
... ... @@ -137,7 +137,18 @@ class MpogSoftwarePlugin < Noosfero::Plugin
137 137 end
138 138  
139 139 def js_files
140   - ["spb-utils.js", "mpog-software.js", "mpog-software-validations.js", "mpog-user-validations.js", "mpog-institution-validations.js", "mpog-incomplete-registration.js", "mpog-search.js", "jquery.maskedinput.min.js", "software-catalog.js"]
  140 + %w[
  141 + jquery.maskedinput.min.js
  142 + spb-utils.js
  143 + mpog-software.js
  144 + mpog-software-validations.js
  145 + mpog-user-validations.js
  146 + mpog-institution-validations.js
  147 + mpog-incomplete-registration.js
  148 + mpog-search.js
  149 + software-catalog.js
  150 + mpog-software-block.js
  151 + ]
141 152 end
142 153  
143 154 def add_new_organization_buttons
... ...
lib/softwares_block.rb
... ... @@ -75,4 +75,16 @@ class SoftwaresBlock < CommunitiesBlock
75 75  
76 76 result.slice(0..get_limit-1)
77 77 end
  78 +
  79 + def content(arg={})
  80 + if self.box.owner_type == "Environment" && self.box.position == 1
  81 + block = self
  82 +
  83 + proc do
  84 + render :file => 'blocks/main_area_softwares', :locals => { :profiles=> block.profile_list() }
  85 + end
  86 + else
  87 + super(arg)
  88 + end
  89 + end
78 90 end
... ...
public/mpog-software-block.js 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +(function($){
  2 + "use strict";// Make javascript less intolerant to errors
  3 +
  4 + var TRANSITION_TIME = 250;// milliseconds
  5 +
  6 +
  7 + function show_finality() {
  8 + var finality = $(this).children(".software-block-finality");
  9 +
  10 + finality.stop().animate({"top" : "0%"}, TRANSITION_TIME);
  11 + }
  12 +
  13 + function hide_finality() {
  14 + var finality = $(this).children(".software-block-finality");
  15 +
  16 + finality.stop().animate({"top" : "100%"}, TRANSITION_TIME);
  17 + }
  18 +
  19 + function set_events() {
  20 + $(".software-block").mouseover(show_finality);
  21 + $(".software-block").mouseout(hide_finality);
  22 + }
  23 +
  24 + $(document).ready(function(){
  25 + set_events();
  26 + });
  27 +})(jQuery);
0 28 \ No newline at end of file
... ...
public/style.css
... ... @@ -234,4 +234,37 @@
234 234 .search-results-type-software_info li {
235 235 width: 100% !important;
236 236 display: block !important;
237   -}
238 237 \ No newline at end of file
  238 +}
  239 +
  240 +/* Start software block main area definitions */
  241 +.software-block {
  242 + position: relative;
  243 + float: left;
  244 + margin: 0px 10px 10px 0px;
  245 + width: 30%;
  246 + height: 200px;
  247 + word-wrap: break-word;
  248 + overflow: hidden;
  249 +}
  250 +
  251 +.software-block-logo {
  252 + width: 150px;
  253 + height: 150px;
  254 + margin: 0px auto;
  255 +}
  256 +
  257 +.software-block-content, .software-block-finality {
  258 + width: 100%;
  259 + height: 100%;
  260 + position: absolute;
  261 + top: 0px;
  262 + left: 0px;
  263 +}
  264 +
  265 +.software-block-finality {
  266 + background-color: #fff;
  267 + top: 100%;
  268 + display: block;
  269 + background-color:rgba(255, 255, 255, 0.9);
  270 +}
  271 +/* End software block main area definitions */
... ...
views/blocks/main_area_softwares.html.erb 0 → 100644
... ... @@ -0,0 +1,24 @@
  1 +<% profiles.each do |profile| %>
  2 + <div class="software-block">
  3 + <div class="software-block-content">
  4 + <div class="software-block-logo">
  5 + <%= link_to profile_image(profile, :big), profile.url %>
  6 + </div>
  7 +
  8 + <div class="software-block-info">
  9 + <div class="software-block-title">
  10 + <h3> <%=profile.name%> </h3>
  11 + </div>
  12 + <div class="software-block-description"><%= profile.description %></div>
  13 + </div>
  14 + </div>
  15 +
  16 + <div class="software-block-finality">
  17 + <p>
  18 + <%= profile.software_info.finality %>
  19 + </p>
  20 +
  21 + <%= link_to _("See More"), profile.url %>
  22 + </div>
  23 + </div>
  24 +<% end %>
0 25 \ No newline at end of file
... ...
views/blocks/search_catalog.html.erb
1 1 <div id="catalogo-software-search">
2 2 <h1><%= _("Catalog of Public Software") %></h1>
3 3 <%= form_tag(controller: "search", action: "software_infos", method: "get") do %>
4   - <%= text_field_tag(:query, nil, :placeholder => "e.g: control, municipal or java", :class=>"searchField", :id=>"search-Gadget") %>
  4 + <%= text_field_tag(:query, nil, :placeholder => "e.g: cacic, e-cidade, gsan, etc", :class=>"searchField", :id=>"search-Gadget") %>
5 5 <%= submit_tag("Search", {:class=>"searchButton-catalog"})%>
6 6 <% end %>
7 7  
8 8 <div id="search-catalog-footer">
9 9 <p><%= _("Access the complete catalog")%>
10   - <%= link_to "", "/search/software_infos" , {:id => "bt_catalog-search"}%></p>
  10 + <%= link_to "", {controller: "search", action: "software_infos"} , {:id => "bt_catalog-search"}%></p>
11 11 </div>
12 12 </div>
... ...