Skip to content

Commit

Permalink
Replaced .length with .size in _responses.html.erb (publiclab#8341)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ljungwaldh authored and wichanart committed Oct 26, 2021
1 parent 741bcd7 commit 7bd0819
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/views/notes/_responses.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<%
tags = "#{response_type}:#{@node.id}"
tags += ',hidden:response' if response_type == 'response'
tags += ",#{(@tagnames.uniq.delete_if{|x| x.match(":") }).join(',')}" if @tagnames && @tagnames.length > 0
tags += ",#{(@tagnames.uniq.delete_if{|x| x.match(":") }).join(',')}" if @tagnames && @tagnames.size > 0
tags += '&n=17223' if response_type == 'photo'
%>
<a class='btn btn-primary btn-lg' href="/post?tags=<%= tags %>">
Expand All @@ -20,7 +20,7 @@

<% if @node.power_tag('activity') %>
<% if Tag.where(name: 'activities:' + @node.power_tag('activity')).first %>
<% if Tag.where(name: 'activities:' + @node.power_tag('activity')).first.nodes.length > 0 %>
<% if Tag.where(name: 'activities:' + @node.power_tag('activity')).first.nodes.size > 0 %>
<a id="other-activities" href="<%= Tag.where(name: 'activities:' + @node.power_tag('activity')).first.nodes.first.path %>">Browse other activities for "<%= @node.power_tag('activity') %>"</a>
<% end %>
<% end %>
Expand All @@ -37,7 +37,7 @@
</div>
<hr />

<h3><%= translation("notes._responses.#{response_type}s") %> (<%= @responses.length %>)</h3>
<h3><%= translation("notes._responses.#{response_type}s") %> (<%= @responses.size %>)</h3>

<% if response_type == 'response' %>
<%= render partial: "notes/notes", locals: { notes: @responses } %>
Expand All @@ -48,7 +48,7 @@
<%= raw insert_extras(" [notes:#{response_type}:#{@node.id}]") %>
<% else %>
<p>
None yet. <a href="/post?tags=<%= response_type %>:<%= @node.id %><% if response_type == 'response' %>,hidden:response<% end %><%= ',' + (@tagnames.uniq.delete_if{|x| x.match(":") }).join(',') if @tagnames && @tagnames.length > 0%>">Be the first to post one!</a>
None yet. <a href="/post?tags=<%= response_type %>:<%= @node.id %><% if response_type == 'response' %>,hidden:response<% end %><%= ',' + (@tagnames.uniq.delete_if{|x| x.match(":") }).join(',') if @tagnames && @tagnames.size > 0%>">Be the first to post one!</a>
</p>
<% end %>
<% end %>
Expand Down

0 comments on commit 7bd0819

Please sign in to comment.