Skip to content

Commit d21ac8c

Browse files
jywarrenPiyush Swain
authored and
Piyush Swain
committed
Remove grey/green checkboxes (publiclab#8471)
* Remove grey/green checkboxes * remove answered and has_accepted_answers methods * remove answers unit tests
1 parent 927fa93 commit d21ac8c

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

app/models/node.rb

-8
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,6 @@ def files
253253
drupal_files
254254
end
255255

256-
def answered
257-
answers&.size&.positive?
258-
end
259-
260-
def has_accepted_answers
261-
answers.where(accepted: true).size.positive?
262-
end
263-
264256
# users who like this node
265257
def likers
266258
node_selections

app/views/grids/_notes.html.erb

-7
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@
4141
<% 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>
4242
<% 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>
4343
<% end %>
44-
<% if node.answered %>
45-
<% if node.has_accepted_answers %>
46-
<i class="fa fa-check-square" style="color:#0c8;"></i>
47-
<% else %>
48-
<i class="fa fa-check-square" style="color:#808080;"></i>
49-
<% end %>
50-
<% end %>
5144
<a href="<%= node.path %>"><%= node.title %></a>
5245
</td>
5346
<td class="author"><a href="/profile/<%= node.author.username %>">@<%= node.author.username %> <%=node.author.new_contributor %></a></td>

test/unit/node_test.rb

-14
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,11 @@ def setup
1414
node = nodes(:about)
1515
assert_equal 'page', node.type
1616
assert_equal 1, node.status
17-
assert !node.answered
1817
assert_equal [], node.location_tags
1918
assert node.body
2019
assert node.summary
2120
end
2221

23-
test 'basic question attributes' do
24-
question = nodes(:question)
25-
assert question.answered
26-
end
27-
2822
test 'basic location attributes' do
2923
map = nodes(:map)
3024
map.add_tag('lat:123', users(:bob))
@@ -417,14 +411,6 @@ def setup
417411
assert_equal 'Jingle Jingle Bells', node.body
418412
end
419413

420-
test "question has an accepted answer" do
421-
question2 = nodes(:question2)
422-
assert !question2.has_accepted_answers
423-
424-
question = nodes(:question)
425-
assert question.has_accepted_answers
426-
end
427-
428414
test "user likes node or not" do
429415
node = nodes(:one)
430416
user = users(:jeff)

0 commit comments

Comments
 (0)