Commit c7c3a74bdd66b767b197bb52b82baadc946756a5
Exists in
master
and in
5 other branches
Merge branch 'blocks'
Conflicts: public/style.css views/blocks/search_catalog.html.erb
Showing
6 changed files
with
111 additions
and
4 deletions
Show diff stats
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 | ... | ... |
... | ... | @@ -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 */ | ... | ... |
... | ... | @@ -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> | ... | ... |