Commit 9e55de1c53be141d712b57a3ccbd537bf91ed3e0

Authored by Thiago Ribeiro
2 parents 8b5c0bc7 f6eaf20a

Merge branch 'stable-spb-1.3' of portal.softwarepublico.gov.br:softwarepublico/n…

…oosfero into stable-spb-1.3
app/helpers/forms_helper.rb
... ... @@ -186,6 +186,7 @@ module FormsHelper
186 186 element_id = html_options[:id] || 'datepicker-date'
187 187 value = value.strftime(format) if value.present?
188 188 method = datepicker_options[:time] ? 'datetimepicker' : 'datepicker'
  189 + current_date_or_nil = value.present? ? "new Date('#{value}')" : "null"
189 190 result = text_field_tag(name, value, html_options)
190 191 result +=
191 192 "
... ... @@ -236,7 +237,7 @@ module FormsHelper
236 237 weekHeader: #{datepicker_options[:week_header].to_json},
237 238 yearRange: #{datepicker_options[:year_range].to_json},
238 239 yearSuffix: #{datepicker_options[:year_suffix].to_json}
239   - }).datepicker('setDate', new Date('#{value}'))
  240 + }).datepicker('setDate', current_date_or_nil)
240 241 </script>
241 242 ".html_safe
242 243 result
... ...
plugins/organization_ratings/features/rate_community.feature
... ... @@ -28,3 +28,9 @@ Feature: rate_community
28 28 Scenario: display rate button inside communities ratings block
29 29 Given I am on mycommunity's homepage
30 30 Then I should see "Rate Community" within ".make-report-block"
  31 +
  32 + Scenario: redirect to profile page
  33 + Given I am on mycommunity's homepage
  34 + When I follow "Rate this Community"
  35 + Then I should see "Joao Silva" within ".star-profile-name"
  36 + And I should see Joao Silva's profile image
31 37 \ No newline at end of file
... ...
plugins/organization_ratings/style.css
... ... @@ -122,6 +122,10 @@
122 122 width: 66px;
123 123 }
124 124  
  125 +.star-profile-name a:link {
  126 + text-decoration: none;
  127 +}
  128 +
125 129 .star-rate-data .star-rate-form .star-comment-container .formfield textarea {
126 130 width: 361px;
127 131 }
... ...
plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb
... ... @@ -9,11 +9,11 @@
9 9  
10 10 <div class="star-profile-information">
11 11 <div class="star-profile-image">
12   - <%= profile_image(current_user.person, :portrait) %>
  12 + <%= link_to profile_image(current_user.person, :portrait), current_user.person.url %>
13 13 </div>
14 14  
15 15 <div class="star-profile-name">
16   - <%= current_user.name %>
  16 + <%= link_to current_user.person.name, current_user.person.url %>
17 17 </div>
18 18 </div>
19 19  
... ...
plugins/organization_ratings/views/shared/_make_report_block.html.erb
1   -<% logged_in_image = profile_image(current_user.person, :portrait) if current_user %>
  1 +<% logged_in_image = link_to profile_image(current_user.person, :portrait), current_user.person.url if current_user %>
  2 +<% logged_in_name = link_to current_user.person.name, current_user.person.url if current_user %>
2 3 <% logged_out_image = image_tag('plugins/organization_ratings/public/images/user-not-logged.png') %>
3 4  
4 5 <div class="make-report-block">
... ... @@ -8,7 +9,7 @@
8 9 </div>
9 10  
10 11 <div class="star-profile-name">
11   - <%= logged_in? ? current_user.person.name : _('User not logged') %>
  12 + <%= logged_in? ? logged_in_name : _('User not logged') %>
12 13 </div>
13 14 </div>
14 15  
... ...
plugins/organization_ratings/views/shared/_user_rating_container.html.erb
1 1 <div class="user-rating-block">
2 2 <div class="star-profile-information">
3 3 <div class="star-profile-image">
4   - <%= profile_image(user_rate.person, :portrait) %>
  4 + <%= link_to profile_image(user_rate.person, :portrait), user_rate.person.url %>
5 5 </div>
6 6  
7 7 <div class="star-profile-name">
8   - <%= user_rate.person.name %>
  8 + <%= link_to user_rate.person.name, user_rate.person.url %>
9 9 </div>
10 10 </div>
11 11  
... ...
test/functional/content_viewer_controller_test.rb
... ... @@ -1163,9 +1163,10 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
1163 1163  
1164 1164 should 'add an zero width space every 4 caracters of comment urls' do
1165 1165 url = 'www.an.url.to.be.splited.com'
1166   - a = fast_create(TextileArticle, :profile_id => @profile.id, :path => 'textile', :language => 'en')
1167   - c = a.comments.create!(:author => @profile, :title => 'An url', :body => url)
1168   - get :view_page, :profile => @profile.identifier, :page => [ 'textile' ]
  1166 + a = @profile.articles.build(:name => 'test')
  1167 + a.save!
  1168 + c = a.comments.create!(:author => @profile, :title => 'An url', :body => url, :source => a)
  1169 + get :view_page, :profile => @profile.identifier, :page => [ 'test' ]
1169 1170 assert_tag :a, :attributes => { :href => "http://" + url}, :content => url.scan(/.{4}/).join('&#x200B;')
1170 1171 end
1171 1172  
... ...