forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update _thumbnail.html.erb to make it consistent with new card display (
publiclab#6581) * Update _thumbnail.html.erb * Update style.css * Update node_shared_test.rb * Update _thumbnail.html.erb * Update _notes.html.erb * Update _notes.html.erb * Update _notes.html.erb * added ApplicationController.helpers.logged_in_as * Update _notes.html.erb * self.current_user in application_helper.rb * Update application_helper.rb * switch to "@current_user && ['admin','moderator'].includes?(@current_user.role)" * PL.editor shows map if lat,lon passed in URL. (publiclab#6788) * pl-editor shows map * indentation * yarn.lock added for PL.editor * safe traverse syntax used * handle nils * Update _notes.html.erb
- Loading branch information
Showing
4 changed files
with
64 additions
and
129 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
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,62 +1,3 @@ | ||
<div class="thumbnail-grid image-container row"> | ||
<% nodes.each_with_index do |node, index| %> | ||
<% if index % 3 == 0 && index > 0 %> | ||
<div class="clearfix d-none d-xl-inline"></div> | ||
<% end %> | ||
<% if index > 8 %> | ||
<div class="d-none note-image col-xl-4 col-lg-6 col-md-6 col-sm-12 col-xs-12 text-center"> | ||
<% else %> | ||
<div class="note-image col-xl-4 col-lg-5 col-md-6 col-sm-12 col-xs-12 text-center"> | ||
<% end %> | ||
<a class="img" href="<%= node.path %>"> | ||
<% if node.main_image %> | ||
<img alt="image" class="img-fluid grid-image" src="<%= node.main_image.path(:default) %>" style="width:100%;height:auto;"> | ||
<% end %> | ||
</a> | ||
<h4 style="padding: 0px; margin: 10px;"><a href="<%=node.path%>" style="padding-top: 0px"><%=node.title%></a></h4> | ||
<p class="meta"><small> | ||
<% if node.type == 'note' %> | ||
by <a href="/profile/<%= node.author.name %>"><%= node.author.name %></a> <%= node.author.new_contributor %> | ||
<%= distance_of_time_in_words(node.created_at, Time.current, { include_seconds: false, scope:'datetime.time_ago_in_words' }) %> | ||
| <a href="<%= node.path %>#comments"><i style="color:#888;" class="fa fa-comment-o"></i> <%= node.comments.size %></a> | ||
<% else %> | ||
<%= t('notes._notes.last_edit_by') %> <a href="/profile/<%= node.latest.author.name %>"><%= node.latest.author.name %></a> | ||
<%= distance_of_time_in_words(Time.at(node.latest.timestamp), Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %> | ||
<% end %> | ||
| <i class="fa fa-eye"></i> <%= number_with_delimiter(node.views) %> <span class="d-none d-md-inline"><%= t('notes._notes.views') %></span> | ||
| <i style="<% if node.likes > 0 %>color:#db4;<% else %>color:#888;<% end %>" class="fa fa-star-o"></i> <%= node.likes %> | ||
| <% 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> <% end %> | ||
</small></p> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% if nodes.count > 8 %> | ||
<div class="row"> | ||
<a id="show-all" class="col-lg-2 col-lg-offset-5 show-all">Show more</a> | ||
</div> | ||
<% end %> | ||
<script> | ||
$('#show-all').on('click', function(){ | ||
if ($('.thumbnail-grid .hidden').length > 0) { | ||
$('.thumbnail-grid .hidden').addClass('show'); | ||
$('.thumbnail-grid .show').removeClass('hidden'); | ||
$('#show-all').html('Show less'); | ||
} else { | ||
$('.thumbnail-grid .show').addClass('hidden'); | ||
$('.thumbnail-grid .show').removeClass('show'); | ||
$('#show-all').html('Show more'); | ||
} | ||
}); | ||
</script> | ||
<style> | ||
.thumbnail-grid .hidden { | ||
display: none; | ||
} | ||
.thumbnail-grid .show { | ||
display: inline-block; | ||
} | ||
.show-all { | ||
color: black; | ||
text-decoration: underline; | ||
} | ||
</style> | ||
<div class="thumbnail-grid"> | ||
<%= render partial: 'notes/notes', locals: { notes: nodes, unpaginated: true } %> | ||
</div> |
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