Skip to content

Commit

Permalink
Merge 8e8d1a6 into ef80bdd
Browse files Browse the repository at this point in the history
  • Loading branch information
KarishmaVanwari authored Mar 31, 2022
2 parents ef80bdd + 8e8d1a6 commit 2e10736
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
20 changes: 9 additions & 11 deletions app/views/grids/_people.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<table class="table inline-grid people-grid <%= className %> <%= className %>-<%= randomSeed %>">
<thead>
<tr>
<th><a data-type="username">Username</a></th>
</tr>
</thead>
<tbody style="height: 500px; overflow: auto; display:block;">

<% if users.empty? %>
<tr>
<td>No matching content.</td>
Expand All @@ -18,15 +22,8 @@
<% end %>
<td class="username"><a href="/profile/<%= user.username %>"><%= user.username %></a> <%=user.new_contributor %></td>
</tr>
<% if index == 9 %>
<tr class="show-all">
<td><a>Show <%= users.length - 10 %> more <b class="caret"></b></a></td>
<td></td>
<td></td>
<td></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<% if !current_user.nil? %>
<p><a class="btn btn-primary" href="/profile/tags/create/<%= current_user.id %>?name=<%= tagname %>">Join this group</a></p>
Expand All @@ -36,13 +33,14 @@
<% end %>
<script>
(function(){
$(".<%= className %>-<%= randomSeed %> .show-all a").click(function() {
$(".<%= className %>-<%= randomSeed %> tr.hide").toggleClass("hide");
});
setupGridSorters(".<%= className %>-<%= randomSeed %>");
})()
</script>
<style>
table thead, tbody tr{
display: table;
width: 100%;
}
a.grid-embed {
float:right;
padding:8px;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/node_shared_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class NodeSharedTest < ActiveSupport::TestCase
html = NodeShared.people_grid(before)
assert_equal 1, html.scan('<table class="table inline-grid people-grid people-grid-organizer people-grid-organizer-').length
assert_equal 1, html.scan('<table').length
assert_equal 6, html.scan('people-grid').length
assert_equal 4, html.scan('people-grid').length
end

test 'that NodeShared can be used to convert short codes like [graph://example.com] into graphs which display csv data' do
Expand Down Expand Up @@ -261,6 +261,6 @@ class NodeSharedTest < ActiveSupport::TestCase
html = NodeShared.people_grid(before)
assert_equal 1, html.scan('<table class="table inline-grid people-grid people-grid-organizer people-grid-organizer-').length
assert_equal 1, html.scan('<table').length
assert_equal 6, html.scan('people-grid').length
assert_equal 4, html.scan('people-grid').length
end
end

0 comments on commit 2e10736

Please sign in to comment.