Skip to content

Commit

Permalink
Remove grey/green checkboxes (publiclab#8471)
Browse files Browse the repository at this point in the history
* Remove grey/green checkboxes

* remove answered and has_accepted_answers methods

* remove answers unit tests
  • Loading branch information
jywarren authored and wichanart committed Oct 26, 2021
1 parent 3648464 commit af438af
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
8 changes: 0 additions & 8 deletions app/models/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@ def files
drupal_files
end

def answered
answers&.size&.positive?
end

def has_accepted_answers
answers.where(accepted: true).size.positive?
end

# users who like this node
def likers
node_selections
Expand Down
7 changes: 0 additions & 7 deletions app/views/grids/_notes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@
<% if node.has_tag("pin:#{tagname}") %><i rel="tooltip" title="This item was pinned with the tag 'pin:<%= tagname %>'." class="fa fa-thumb-tack"></i>
<% elsif node.has_tag("pin:question:#{tagname}") %><i rel="tooltip" title="This item was pinned with the tag 'pin:question:<%= tagname %>'." class="fa fa-thumb-tack"></i>
<% end %>
<% if node.answered %>
<% if node.has_accepted_answers %>
<i class="fa fa-check-square" style="color:#0c8;"></i>
<% else %>
<i class="fa fa-check-square" style="color:#808080;"></i>
<% end %>
<% end %>
<a href="<%= node.path %>"><%= node.title %></a>
</td>
<td class="author"><a href="/profile/<%= node.author.username %>">@<%= node.author.username %> <%=node.author.new_contributor %></a></td>
Expand Down
14 changes: 0 additions & 14 deletions test/unit/node_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ def setup
node = nodes(:about)
assert_equal 'page', node.type
assert_equal 1, node.status
assert !node.answered
assert_equal [], node.location_tags
assert node.body
assert node.summary
end

test 'basic question attributes' do
question = nodes(:question)
assert question.answered
end

test 'basic location attributes' do
map = nodes(:map)
map.add_tag('lat:123', users(:bob))
Expand Down Expand Up @@ -417,14 +411,6 @@ def setup
assert_equal 'Jingle Jingle Bells', node.body
end

test "question has an accepted answer" do
question2 = nodes(:question2)
assert !question2.has_accepted_answers

question = nodes(:question)
assert question.has_accepted_answers
end

test "user likes node or not" do
node = nodes(:one)
user = users(:jeff)
Expand Down

0 comments on commit af438af

Please sign in to comment.