Commit e9a68a7d0dec0895988af4097d0ca0b460810ed3
Exists in
master
and in
53 other branches
Merge branch 'stable-4.x' of portal.softwarepublico.gov.br:softwarepublico/softw…
…arepublico into stable-4.x
Showing
14 changed files
with
264 additions
and
26 deletions
Show diff stats
cookbooks/noosfero/files/noosfero-create-api-user
... | ... | @@ -5,13 +5,19 @@ email = ARGV[1] |
5 | 5 | password = SecureRandom.random_number.to_s |
6 | 6 | |
7 | 7 | user = User.find_by_login(login) |
8 | -exit(0) if user | |
9 | - | |
10 | -user = User.create!( | |
11 | - login: login, | |
12 | - email: email, | |
13 | - password: password, | |
14 | - password_confirmation: password | |
15 | -) | |
16 | -user.activate | |
17 | -user.generate_private_token! | |
8 | +if user | |
9 | + if user.private_token_expired? | |
10 | + user.generate_private_token! | |
11 | + else | |
12 | + exit(0) | |
13 | + end | |
14 | +else | |
15 | + user = User.create!( | |
16 | + login: login, | |
17 | + email: email, | |
18 | + password: password, | |
19 | + password_confirmation: password | |
20 | + ) | |
21 | + user.activate | |
22 | + user.generate_private_token! | |
23 | +end | ... | ... |
src/noosfero-spb/software_communities/features/step_definitions/software_communities_steps.rb
... | ... | @@ -151,7 +151,7 @@ Given /^the user "([^"]*)" has "([^"]*)" as secondary e\-mail$/ do |login, email |
151 | 151 | end |
152 | 152 | |
153 | 153 | Given /^I click on anything with selector "([^"]*)"$/ do |selector| |
154 | - evaluate_script "jQuery('#{selector}').trigger('click') && true" | |
154 | + page.evaluate_script("jQuery('##{selector}').click();") | |
155 | 155 | end |
156 | 156 | |
157 | 157 | Given /^I should see "([^"]*)" of this selector "([^"]*)"$/ do |quantity, selector| | ... | ... |
src/noosfero-spb/software_communities/features/use_report.feature
0 → 100644
... | ... | @@ -0,0 +1,56 @@ |
1 | +Feature: Use report | |
2 | + As a user | |
3 | + I want to make a use report of a software | |
4 | + to give my feedback about a software. | |
5 | + | |
6 | + Background: | |
7 | + Given "SoftwareCommunitiesPlugin" plugin is enabled | |
8 | + Given "OrganizationRatings" plugin is enabled | |
9 | + And I am logged in as mpog_admin | |
10 | + And I go to /admin/plugins | |
11 | + And I check "SoftwareCommunitiesPlugin" | |
12 | + And I press "Save changes" | |
13 | + And the following softwares | |
14 | + | name | public_software | finality | | |
15 | + | Noosfero | true | some finality | | |
16 | + | |
17 | + Scenario: Add Organization Ratings Block | |
18 | + Given I go to Noosfero's control panel | |
19 | + And I follow "Edit sideboxes" | |
20 | + When I follow "Add a block" | |
21 | + And I choose "Organization Ratings" | |
22 | + And I press "Add" | |
23 | + Then I should see "Report your experiences" | |
24 | + | |
25 | + Scenario: Add Average Rating Block | |
26 | + Given I go to Noosfero's control panel | |
27 | + And I follow "Edit sideboxes" | |
28 | + When I follow "Add a block" | |
29 | + And I choose "Organization Average Rating" | |
30 | + And I press "Add" | |
31 | + Then I should see "Be the first to rate!" | |
32 | + | |
33 | + @selenium | |
34 | + Scenario: Test Additional Fields JavaScript | |
35 | + Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | |
36 | + Then I should not see "Number of Beneficiaries" | |
37 | + And I should not see "Saved Resources" | |
38 | + When I click on anything with selector "comments-additional-information" | |
39 | + Then I should see "Number of Beneficiaries" | |
40 | + And I should see "Saved Resources" | |
41 | + | |
42 | + @selenium | |
43 | + Scenario: Validate Use Report fields format | |
44 | + Given I go to Noosfero's control panel | |
45 | + Given I follow "Edit sideboxes" | |
46 | + When I follow "Add a block" | |
47 | + And I choose "Organization Ratings" | |
48 | + And I press "Add" | |
49 | + And I am on Noosfero's homepage | |
50 | + And I follow "Rate Community" | |
51 | + When I click on anything with selector "comments-additional-information" | |
52 | + And I fill in "organization_rating_people_benefited" with "123123" | |
53 | + And I fill in "organization_rating_saved_value" with "7654321" | |
54 | + And I press "Save" | |
55 | + Then I should see "Benefited People: 123.123" | |
56 | + And I should see "Saved Resources: $ 76,543.21" | ... | ... |
src/noosfero-spb/software_communities/lib/software_communities_plugin.rb
... | ... | @@ -43,7 +43,8 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin |
43 | 43 | SoftwareHighlightsBlock => { :type => [Environment] }, |
44 | 44 | SoftwareTabDataBlock => {:type => [Community], :position => 1}, |
45 | 45 | WikiBlock => {:type => [Community]}, |
46 | - StatisticBlock => { :type => [Community] } | |
46 | + StatisticBlock => { :type => [Community] }, | |
47 | + SoftwareEventsBlock => { :type => [Community] } | |
47 | 48 | } |
48 | 49 | end |
49 | 50 | ... | ... |
src/noosfero-spb/software_communities/lib/software_events_block.rb
0 → 100644
... | ... | @@ -0,0 +1,44 @@ |
1 | +class SoftwareEventsBlock < Block | |
2 | + | |
3 | + def self.description | |
4 | + _('Software community events') | |
5 | + end | |
6 | + | |
7 | + def help | |
8 | + _('This block displays the software community events in a list.') | |
9 | + end | |
10 | + | |
11 | + def content(args={}) | |
12 | + block = self | |
13 | + | |
14 | + lambda do |object| | |
15 | + render( | |
16 | + :file => 'blocks/software_events', | |
17 | + :locals => { :block => block } | |
18 | + ) | |
19 | + end | |
20 | + end | |
21 | + | |
22 | + def cacheable? | |
23 | + false | |
24 | + end | |
25 | + | |
26 | + def get_events | |
27 | + today = DateTime.now.beginning_of_day | |
28 | + self.owner.events.where("end_date >= ?", today).order(:start_date) | |
29 | + end | |
30 | + | |
31 | + def get_events_except event_slug="" | |
32 | + event_slug = "" if event_slug.nil? | |
33 | + | |
34 | + get_events.where("slug NOT IN (?)", event_slug) | |
35 | + end | |
36 | + | |
37 | + def has_events_to_display? | |
38 | + not get_events.empty? | |
39 | + end | |
40 | + | |
41 | + def should_display_title? | |
42 | + self.box.position != 1 | |
43 | + end | |
44 | +end | ... | ... |
src/noosfero-spb/software_communities/public/vendor/jquery.maskedinput.min.js
1 | -/* | |
2 | - Masked Input plugin for jQuery | |
3 | - Copyright (c) 2007-2013 Josh Bush (digitalbush.com) | |
4 | - Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) | |
5 | - Version: 1.3.1 | |
6 | -*/ | |
7 | -(function(e){function t(){var e=document.createElement("input"),t="onpaste";return e.setAttribute(t,""),"function"==typeof e[t]?"paste":"input"}var n,a=t()+".mask",r=navigator.userAgent,i=/iphone/i.test(r),o=/android/i.test(r);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&(n=this.createTextRange(),n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,r){var c,l,s,u,f,h;return!t&&this.length>0?(c=e(this[0]),c.data(e.mask.dataName)()):(r=e.extend({placeholder:e.mask.placeholder,completed:null},r),l=e.mask.definitions,s=[],u=h=t.length,f=null,e.each(t.split(""),function(e,t){"?"==t?(h--,u=e):l[t]?(s.push(RegExp(l[t])),null===f&&(f=s.length-1)):s.push(null)}),this.trigger("unmask").each(function(){function c(e){for(;h>++e&&!s[e];);return e}function d(e){for(;--e>=0&&!s[e];);return e}function m(e,t){var n,a;if(!(0>e)){for(n=e,a=c(t);h>n;n++)if(s[n]){if(!(h>a&&s[n].test(R[a])))break;R[n]=R[a],R[a]=r.placeholder,a=c(a)}b(),x.caret(Math.max(f,e))}}function p(e){var t,n,a,i;for(t=e,n=r.placeholder;h>t;t++)if(s[t]){if(a=c(t),i=R[t],R[t]=n,!(h>a&&s[a].test(i)))break;n=i}}function g(e){var t,n,a,r=e.which;8===r||46===r||i&&127===r?(t=x.caret(),n=t.begin,a=t.end,0===a-n&&(n=46!==r?d(n):a=c(n-1),a=46===r?c(a):a),k(n,a),m(n,a-1),e.preventDefault()):27==r&&(x.val(S),x.caret(0,y()),e.preventDefault())}function v(t){var n,a,i,l=t.which,u=x.caret();t.ctrlKey||t.altKey||t.metaKey||32>l||l&&(0!==u.end-u.begin&&(k(u.begin,u.end),m(u.begin,u.end-1)),n=c(u.begin-1),h>n&&(a=String.fromCharCode(l),s[n].test(a)&&(p(n),R[n]=a,b(),i=c(n),o?setTimeout(e.proxy(e.fn.caret,x,i),0):x.caret(i),r.completed&&i>=h&&r.completed.call(x))),t.preventDefault())}function k(e,t){var n;for(n=e;t>n&&h>n;n++)s[n]&&(R[n]=r.placeholder)}function b(){x.val(R.join(""))}function y(e){var t,n,a=x.val(),i=-1;for(t=0,pos=0;h>t;t++)if(s[t]){for(R[t]=r.placeholder;pos++<a.length;)if(n=a.charAt(pos-1),s[t].test(n)){R[t]=n,i=t;break}if(pos>a.length)break}else R[t]===a.charAt(pos)&&t!==u&&(pos++,i=t);return e?b():u>i+1?(x.val(""),k(0,h)):(b(),x.val(x.val().substring(0,i+1))),u?t:f}var x=e(this),R=e.map(t.split(""),function(e){return"?"!=e?l[e]?r.placeholder:e:void 0}),S=x.val();x.data(e.mask.dataName,function(){return e.map(R,function(e,t){return s[t]&&e!=r.placeholder?e:null}).join("")}),x.attr("readonly")||x.one("unmask",function(){x.unbind(".mask").removeData(e.mask.dataName)}).bind("focus.mask",function(){clearTimeout(n);var e;S=x.val(),e=y(),n=setTimeout(function(){b(),e==t.length?x.caret(0,e):x.caret(e)},10)}).bind("blur.mask",function(){y(),x.val()!=S&&x.change()}).bind("keydown.mask",g).bind("keypress.mask",v).bind(a,function(){setTimeout(function(){var e=y(!0);x.caret(e),r.completed&&e==x.val().length&&r.completed.call(x)},0)}),y()}))}})})(jQuery); | |
8 | 1 | \ No newline at end of file |
2 | +// jQuery Mask Plugin v1.13.4 | |
3 | +// github.com/igorescobar/jQuery-Mask-Plugin | |
4 | +(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?module.exports=b(require("jquery")):b(jQuery||Zepto)})(function(b){var y=function(a,c,d){a=b(a);var g=this,k=a.val(),l;c="function"===typeof c?c(a.val(),void 0,a,d):c;var e={invalid:[],getCaret:function(){try{var q,b=0,e=a.get(0),f=document.selection,c=e.selectionStart;if(f&&-1===navigator.appVersion.indexOf("MSIE 10"))q=f.createRange(),q.moveStart("character",a.is("input")?-a.val().length:-a.text().length), | |
5 | +b=q.text.length;else if(c||"0"===c)b=c;return b}catch(d){}},setCaret:function(q){try{if(a.is(":focus")){var b,c=a.get(0);c.setSelectionRange?c.setSelectionRange(q,q):c.createTextRange&&(b=c.createTextRange(),b.collapse(!0),b.moveEnd("character",q),b.moveStart("character",q),b.select())}}catch(f){}},events:function(){a.on("input.mask keyup.mask",e.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){a.keydown().keyup()},100)}).on("change.mask",function(){a.data("changed",!0)}).on("blur.mask", | |
6 | +function(){k===a.val()||a.data("changed")||a.triggerHandler("change");a.data("changed",!1)}).on("blur.mask",function(){k=a.val()}).on("focus.mask",function(a){!0===d.selectOnFocus&&b(a.target).select()}).on("focusout.mask",function(){d.clearIfNotMatch&&!l.test(e.val())&&e.val("")})},getRegexMask:function(){for(var a=[],b,e,f,d,h=0;h<c.length;h++)(b=g.translation[c.charAt(h)])?(e=b.pattern.toString().replace(/.{1}$|^.{1}/g,""),f=b.optional,(b=b.recursive)?(a.push(c.charAt(h)),d={digit:c.charAt(h), | |
7 | +pattern:e}):a.push(f||b?e+"?":e)):a.push(c.charAt(h).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));a=a.join("");d&&(a=a.replace(new RegExp("("+d.digit+"(.*"+d.digit+")?)"),"($1)?").replace(new RegExp(d.digit,"g"),d.pattern));return new RegExp(a)},destroyEvents:function(){a.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask "))},val:function(b){var c=a.is("input")?"val":"text";if(0<arguments.length){if(a[c]()!==b)a[c](b);c=a}else c=a[c]();return c},getMCharsBeforeCount:function(a, | |
8 | +b){for(var e=0,f=0,d=c.length;f<d&&f<a;f++)g.translation[c.charAt(f)]||(a=b?a+1:a,e++);return e},caretPos:function(a,b,d,f){return g.translation[c.charAt(Math.min(a-1,c.length-1))]?Math.min(a+d-b-f,d):e.caretPos(a+1,b,d,f)},behaviour:function(a){a=a||window.event;e.invalid=[];var c=a.keyCode||a.which;if(-1===b.inArray(c,g.byPassKeys)){var d=e.getCaret(),f=e.val().length,n=d<f,h=e.getMasked(),k=h.length,m=e.getMCharsBeforeCount(k-1)-e.getMCharsBeforeCount(f-1);e.val(h);!n||65===c&&a.ctrlKey||(8!== | |
9 | +c&&46!==c&&(d=e.caretPos(d,f,k,m)),e.setCaret(d));return e.callbacks(a)}},getMasked:function(a){var b=[],k=e.val(),f=0,n=c.length,h=0,l=k.length,m=1,p="push",u=-1,t,w;d.reverse?(p="unshift",m=-1,t=0,f=n-1,h=l-1,w=function(){return-1<f&&-1<h}):(t=n-1,w=function(){return f<n&&h<l});for(;w();){var x=c.charAt(f),v=k.charAt(h),r=g.translation[x];if(r)v.match(r.pattern)?(b[p](v),r.recursive&&(-1===u?u=f:f===t&&(f=u-m),t===u&&(f-=m)),f+=m):r.optional?(f+=m,h-=m):r.fallback?(b[p](r.fallback),f+=m,h-=m):e.invalid.push({p:h, | |
10 | +v:v,e:r.pattern}),h+=m;else{if(!a)b[p](x);v===x&&(h+=m);f+=m}}a=c.charAt(t);n!==l+1||g.translation[a]||b.push(a);return b.join("")},callbacks:function(b){var g=e.val(),l=g!==k,f=[g,b,a,d],n=function(a,b,c){"function"===typeof d[a]&&b&&d[a].apply(this,c)};n("onChange",!0===l,f);n("onKeyPress",!0===l,f);n("onComplete",g.length===c.length,f);n("onInvalid",0<e.invalid.length,[g,b,a,e.invalid,d])}};g.mask=c;g.options=d;g.remove=function(){var b=e.getCaret();e.destroyEvents();e.val(g.getCleanVal());e.setCaret(b- | |
11 | +e.getMCharsBeforeCount(b));return a};g.getCleanVal=function(){return e.getMasked(!0)};g.init=function(c){c=c||!1;d=d||{};g.byPassKeys=b.jMaskGlobals.byPassKeys;g.translation=b.jMaskGlobals.translation;g.translation=b.extend({},g.translation,d.translation);g=b.extend(!0,{},g,d);l=e.getRegexMask();!1===c?(d.placeholder&&a.attr("placeholder",d.placeholder),b("input").length&&!1==="oninput"in b("input")[0]&&"on"===a.attr("autocomplete")&&a.attr("autocomplete","off"),e.destroyEvents(),e.events(),c=e.getCaret(), | |
12 | +e.val(e.getMasked()),e.setCaret(c+e.getMCharsBeforeCount(c,!0))):(e.events(),e.val(e.getMasked()))};g.init(!a.is("input"))};b.maskWatchers={};var A=function(){var a=b(this),c={},d=a.attr("data-mask");a.attr("data-mask-reverse")&&(c.reverse=!0);a.attr("data-mask-clearifnotmatch")&&(c.clearIfNotMatch=!0);"true"===a.attr("data-mask-selectonfocus")&&(c.selectOnFocus=!0);if(z(a,d,c))return a.data("mask",new y(this,d,c))},z=function(a,c,d){d=d||{};var g=b(a).data("mask"),k=JSON.stringify;a=b(a).val()|| | |
13 | +b(a).text();try{return"function"===typeof c&&(c=c(a)),"object"!==typeof g||k(g.options)!==k(d)||g.mask!==c}catch(l){}};b.fn.mask=function(a,c){c=c||{};var d=this.selector,g=b.jMaskGlobals,k=b.jMaskGlobals.watchInterval,l=function(){if(z(this,a,c))return b(this).data("mask",new y(this,a,c))};b(this).each(l);d&&""!==d&&g.watchInputs&&(clearInterval(b.maskWatchers[d]),b.maskWatchers[d]=setInterval(function(){b(document).find(d).each(l)},k));return this};b.fn.unmask=function(){clearInterval(b.maskWatchers[this.selector]); | |
14 | +delete b.maskWatchers[this.selector];return this.each(function(){var a=b(this).data("mask");a&&a.remove().removeData("mask")})};b.fn.cleanVal=function(){return this.data("mask").getCleanVal()};b.applyDataMask=function(a){a=a||b.jMaskGlobals.maskElements;(a instanceof b?a:b(a)).filter(b.jMaskGlobals.dataMaskAttr).each(A)};var p={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/}, | |
15 | +9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};b.jMaskGlobals=b.jMaskGlobals||{};p=b.jMaskGlobals=b.extend(!0,{},p,b.jMaskGlobals);p.dataMask&&b.applyDataMask();setInterval(function(){b.jMaskGlobals.watchDataMask&&b.applyDataMask()},p.watchInterval)}); | |
16 | + | ... | ... |
src/noosfero-spb/software_communities/public/views/comments-software-extra-fields.js
... | ... | @@ -15,6 +15,24 @@ modulejs.define('CommentsSoftwareExtraFields', ['jquery'], function($) { |
15 | 15 | $(".comments-software-extra-fields div").hide(); |
16 | 16 | } |
17 | 17 | }); |
18 | + var organization_rating_saved_value = $("#organization_rating_saved_value"); | |
19 | + var organization_rating_people_benefited = $("#organization_rating_people_benefited"); | |
20 | + var people_benefited_tmp = $("#people_benefited_tmp"); | |
21 | + var saved_value_tmp = $("#saved_value_tmp"); | |
22 | + | |
23 | + saved_value_tmp.mask("#.##0,00", {reverse: true}); | |
24 | + people_benefited_tmp.mask("000.000.000", {reverse: true}); | |
25 | + | |
26 | + organization_rating_saved_value.closest("form").submit(function( event ) { | |
27 | + var unformated_saved_value = saved_value_tmp.val(); | |
28 | + unformated_saved_value = unformated_saved_value.split(".").join(""); | |
29 | + unformated_saved_value = unformated_saved_value.replace(",","."); | |
30 | + organization_rating_saved_value.val(unformated_saved_value); | |
31 | + | |
32 | + var unformated_people_benefited = people_benefited_tmp.val(); | |
33 | + unformated_people_benefited = unformated_people_benefited.split(".").join(""); | |
34 | + organization_rating_people_benefited.val(unformated_people_benefited); | |
35 | + }); | |
18 | 36 | } |
19 | 37 | |
20 | 38 | return { | ... | ... |
src/noosfero-spb/software_communities/test/unit/software_events_block_test.rb
0 → 100644
... | ... | @@ -0,0 +1,63 @@ |
1 | +require File.dirname(__FILE__) + '/../../../../test/test_helper' | |
2 | +require File.dirname(__FILE__) + '/../helpers/plugin_test_helper' | |
3 | + | |
4 | +class SoftwareEventsBlockTest < ActiveSupport::TestCase | |
5 | + include PluginTestHelper | |
6 | + | |
7 | + def setup | |
8 | + @community = create_community("A new community") | |
9 | + @software_events_block = SoftwareEventsBlock.new | |
10 | + | |
11 | + box = Box.new | |
12 | + box.position = 1 | |
13 | + box.owner = @community | |
14 | + box.blocks << @software_events_block | |
15 | + box.save! | |
16 | + | |
17 | + @e1 = Event.new :name=>"Event 1", :body=>"Event 1 body", | |
18 | + :start_date=>DateTime.now, :end_date=>(DateTime.now + 1.month) | |
19 | + | |
20 | + @e2 = Event.new :name=>"Event 2", :body=>"Event 2 body", | |
21 | + :start_date=>(DateTime.now - 10.days), :end_date=>(DateTime.now + 10.days) | |
22 | + | |
23 | + @e3 = Event.new :name=>"Event 3", :body=>"Event 3 body", | |
24 | + :start_date=>(DateTime.now - 20.days), :end_date=>(DateTime.now - 10.days) | |
25 | + | |
26 | + @community.events << @e1 | |
27 | + @community.events << @e2 | |
28 | + @community.events << @e3 | |
29 | + @community.save! | |
30 | + end | |
31 | + | |
32 | + should "give community events that have not yet finished ordered by start date" do | |
33 | + events = @software_events_block.get_events | |
34 | + | |
35 | + assert_equal false, events.include?(@e3) | |
36 | + assert_equal @e2, events.first | |
37 | + assert_equal @e1, events.last | |
38 | + end | |
39 | + | |
40 | + should "give community events except by a event with a given slug" do | |
41 | + events = @software_events_block.get_events_except(@e1.slug) | |
42 | + | |
43 | + assert_equal false, events.include?(@e1) | |
44 | + end | |
45 | + | |
46 | + should "tell if there are events to be displayed" do | |
47 | + assert_equal true, @software_events_block.has_events_to_display? | |
48 | + | |
49 | + @community.events.update_all :start_date => (DateTime.now - 2.days), | |
50 | + :end_date => (DateTime.now - 1.day) | |
51 | + | |
52 | + assert_equal false, @software_events_block.has_events_to_display? | |
53 | + end | |
54 | + | |
55 | + should "tell that the block must show the title in other areas that are no the main area" do | |
56 | + assert_equal false, @software_events_block.should_display_title? | |
57 | + | |
58 | + @software_events_block.box.position = 3 | |
59 | + @software_events_block.save! | |
60 | + | |
61 | + assert_equal true, @software_events_block.should_display_title? | |
62 | + end | |
63 | +end | ... | ... |
src/noosfero-spb/software_communities/views/blocks/_software_events_list_item.html.erb
0 → 100644
... | ... | @@ -0,0 +1,9 @@ |
1 | +<div class="software-events-list-item-calendar"></div> | |
2 | + | |
3 | +<span class="software-events-list-item-date"> | |
4 | + <%= event.start_date.strftime "%d/%m - " %> | |
5 | +</span> | |
6 | + | |
7 | +<span class="software-events-list-item-title"> | |
8 | + <%= link_to event.title, event.url %> | |
9 | +</span> | ... | ... |
src/noosfero-spb/software_communities/views/blocks/software_events.html.erb
0 → 100644
... | ... | @@ -0,0 +1,22 @@ |
1 | +<div class="software-community-events-block"> | |
2 | + <% if block.has_events_to_display? %> | |
3 | + <ul class="software-community-events-list"> | |
4 | + | |
5 | + <% if block.should_display_title? %> | |
6 | + <li class="software-events-list-item"> | |
7 | + <span class="software-events-list-item-title"> | |
8 | + <%= block.title %> | |
9 | + </span> | |
10 | + </li> | |
11 | + <% end %> | |
12 | + | |
13 | + <% block.get_events_except(params[:page]).each do |event| %> | |
14 | + <li class="software-events-list-item"> | |
15 | + <%= render :partial=>"blocks/software_events_list_item", | |
16 | + :locals => {:event => event} %> | |
17 | + </li> | |
18 | + <% end %> | |
19 | + | |
20 | + </ul> | |
21 | + <% end %> | |
22 | +</div> | ... | ... |
src/noosfero-spb/software_communities/views/comments_extra_fields.html.erb
... | ... | @@ -10,12 +10,14 @@ |
10 | 10 | <div class="comments-software-people-benefited"> |
11 | 11 | <%= label_tag "comments_people_benefited", _("Number of Beneficiaries")%> |
12 | 12 | <span class="star-tooltip" title="Quantidade de pessoas beneficiadas com a utilização do software"></span> |
13 | - <%= text_field_tag "organization_rating[people_benefited]", "" %> | |
13 | + <%= text_field_tag "people_benefited_tmp", "" %> | |
14 | + <%= hidden_field_tag "organization_rating[people_benefited]", "" %> | |
14 | 15 | </div> |
15 | 16 | |
16 | 17 | <div class="comments-software-saved-values"> |
17 | - <%= label_tag "comments_saved_value", _("Saved resources")%> | |
18 | + <%= label_tag "comments_saved_value", _("Saved Resources")%> | |
18 | 19 | <span class="star-tooltip" title="Valores em “Real” economizados com a utilização do software"></span> |
19 | - <%= text_field_tag "organization_rating[saved_value]", "", :placeholder=>"R$"%> | |
20 | + <%= text_field_tag "saved_value_tmp", "", :placeholder=>"R$" %> | |
21 | + <%= hidden_field_tag "organization_rating[saved_value]","" %> | |
20 | 22 | </div> |
21 | 23 | </div> | ... | ... |
src/noosfero-spb/software_communities/views/organization_ratings_extra_fields_show_data.html.erb
1 | 1 | <div class="aditional-informations"> |
2 | 2 | <div class="comments-people-benefited"> |
3 | - <span><%=_("Benefited People")%> :</span> <%= user_rating.people_benefited unless user_rating.nil? %> | |
3 | + <span><%=_("Benefited People")%>:</span> <%= number_with_delimiter(user_rating.people_benefited, :separator => environment.currency_separator, :delimiter => environment.currency_delimiter) unless user_rating.nil? %> | |
4 | 4 | </div> |
5 | 5 | |
6 | 6 | <div class="comments-saved-value"> |
7 | - <span><%=_("Saved Resources")%> :</span> <%= user_rating.saved_value unless user_rating.nil? %> | |
7 | + <span><%=_("Saved Resources")%>:</span> <%= float_to_currency(user_rating.saved_value) unless user_rating.nil? %> | |
8 | 8 | </div> |
9 | 9 | </div> |
10 | 10 | ... | ... |
src/noosfero-spb/spb_migrations/db/migrate/20151106172419_remove_softwares_without_community.rb
0 → 100644
src/pkg-rpm/colab/colab.spec
1 | 1 | %define name colab |
2 | -%define version 1.11.3 | |
2 | +%define version 1.11.4 | |
3 | 3 | %define buildvenv /var/tmp/%{name}-%{version} |
4 | 4 | |
5 | 5 | Summary: Collaboration platform for communities |
6 | 6 | Name: %{name} |
7 | 7 | Version: %{version} |
8 | -Release: 23 | |
8 | +Release: 1 | |
9 | 9 | Source0: %{name}-%{version}.tar.gz |
10 | 10 | License: GPLv2 |
11 | 11 | Group: Development/Tools | ... | ... |