-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2694 from jayto581/jc/109/implement-sticking
feat: add sticky table header and column sort buttons (#109)
- Loading branch information
Showing
9 changed files
with
293 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,10 @@ | |
} | ||
} | ||
} | ||
|
||
/** | ||
* Add/remove margins | ||
*/ | ||
.push--top40 { | ||
margin-top: 40px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,68 @@ | ||
<% print_friendly = (defined?(@printable_format) && @printable_format) ? true : false %> | ||
|
||
<table class="table--bordered table--striped table--data "> | ||
<thead> | ||
<tr> | ||
<% unless print_friendly %> | ||
<th >Details</th> | ||
<th class='sticky-header-freereg'>Details</th> | ||
<% end %> | ||
<th> | ||
<% unless print_friendly %><%= link_to('Person or persons', | ||
reorder_search_query_path(@search_query, :order_field => SearchQuery::SearchOrder::NAME)) %> | ||
<% else%> Person or persons<% end%> | ||
<th class='sticky-header-freereg'> | ||
Person or persons | ||
</th> | ||
<th> | ||
<% unless print_friendly %><%= link_to('Record type', | ||
reorder_search_query_path(@search_query, :order_field => SearchQuery::SearchOrder::TYPE)) %> | ||
<% else%> Record type<% end%> | ||
<th class='sticky-header-freereg'> | ||
Record type | ||
</th> | ||
<th> | ||
<% unless print_friendly %><%= link_to('Event date', | ||
reorder_search_query_path(@search_query, :order_field => SearchQuery::SearchOrder::DATE)) %> | ||
<% else%> Event date<% end%> | ||
<th class='sticky-header-freereg'> | ||
Event date | ||
</th> | ||
<th> | ||
<% unless print_friendly %><%= link_to('County', | ||
reorder_search_query_path(@search_query, :order_field => SearchQuery::SearchOrder::COUNTY)) %> | ||
<% else%> County<% end%> | ||
<th class='sticky-header-freereg'> | ||
County | ||
</th> | ||
<th> | ||
<% unless print_friendly %><%= link_to("Place : Church : Register type", | ||
reorder_search_query_path(@search_query, :order_field => SearchQuery::SearchOrder::LOCATION)) %> | ||
<% else%> Place : Church : Register type<% end%> | ||
<th class='sticky-header-freereg'> | ||
Place : Church : Register type | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<% n = 0 %> | ||
<% search_results.each do |search_record| %> | ||
<% n = n + 1 %> | ||
<tr id="<%=search_record.id%>"> | ||
<%= render partial: 'display_freereg_search_record_desktop', :locals => {:search_record => search_record, :print_friendly => print_friendly, :n => n}%> | ||
|
||
<tr id="<%= search_record.id %>"> | ||
<%= render partial: "display_freereg_search_record_desktop", | ||
locals: { | ||
search_record: search_record, | ||
print_friendly: print_friendly, | ||
n: n | ||
} %> | ||
</tr> | ||
<% end %> | ||
|
||
<% if ucf_results && ucf_results.length > 0 %> | ||
<tr> | ||
<td colspan="6"> Additional possible matches with records containing Uncertain Character Formatting </td> | ||
<td colspan="6"> | ||
Additional possible matches with records containing Uncertain Character Formatting | ||
</td> | ||
</tr> | ||
|
||
<% ucf_results.each do |search_record| %> | ||
<% n = n + 1 %> | ||
<tr id="<%=search_record.id%>"> | ||
<%= render partial: 'display_freereg_search_record_desktop', :locals => {:search_record => search_record, :print_friendly => print_friendly, :n => n}%> | ||
<tr id="<%= search_record.id %>"> | ||
<%= render partial: "display_freereg_search_record_desktop", | ||
locals: { | ||
search_record: search_record, | ||
print_friendly: print_friendly, | ||
n: n | ||
} %> | ||
</tr> | ||
<% end %> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</table> | ||
|
||
<% unless print_friendly %> | ||
<div class='text--center inline-block'> | ||
<%= paginate @paginatable_array if @paginatable_array.present? %> | ||
</div> | ||
<% end %> |
25 changes: 15 additions & 10 deletions
25
app/views/search_queries/_display_freereg_search_record_desktop.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
<% unless print_friendly %> | ||
<td> | ||
<%= link_to("View #{n}", friendly_search_record_path(search_record.id, search_record.friendly_url),rel:"nofollow", :class => "btn btn--small" )%> | ||
<%= link_to( | ||
"View #{n}", | ||
friendly_search_record_path(search_record.id, search_record.friendly_url), | ||
rel: "nofollow", | ||
class: "btn btn--small" | ||
) %> | ||
<i><br> | ||
<%= viewed(@search_query,search_record) %></i> | ||
<%= viewed(@search_query, search_record) %></i> | ||
</td> | ||
<% end %> | ||
<td > | ||
<td> | ||
<% search_record[:transcript_names].uniq.each_with_index do |name, i| %> | ||
<% if name['type'] == 'primary' %> | ||
<% if i > 0 %> | ||
<br /> | ||
<% end%> | ||
<% end %> | ||
<%= "#{name['first_name']} #{name['last_name']} " %> | ||
<% end %> | ||
<% end%> | ||
<% end %> | ||
</td> | ||
<td > | ||
<td> | ||
<%= RecordType::display_name(search_record.record_type) %> | ||
</td> | ||
<td > | ||
<td> | ||
<%= transcript_date(search_record) %> | ||
</td> | ||
<td > | ||
<td> | ||
<%= county(search_record) %> | ||
</td> | ||
<td > | ||
<td> | ||
<%= format_location(search_record) %> | ||
</td> | ||
</td> |
Oops, something went wrong.