forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Profile page likes are now rendered on the same page (publiclab#2293)
- Loading branch information
1 parent
892dc6b
commit a5587a7
Showing
3 changed files
with
75 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<div id="notes"> | ||
<div class="row"> | ||
<% @likes.each_with_index do |like,i| %> | ||
<div class="<% if @widget %>col-xs-3 col-sm-3 <% end %><%= like.tagnames_as_classes %> col-md-3 clearfix like note like-nid-<%= like.id %> note-nid-<%= like.id %><% if like.status == 4 %> moderated<% end %>" style="overflow:hidden; text-align:center"> | ||
|
||
<% if like.main_image %> | ||
<a class="img" <% if @widget %>target="_blank"<% end %> href="<%= like.path %>"><img src="<%= like.main_image.path(:default) %>" style="width:100%;" /></a> | ||
<% end %> | ||
|
||
<% if like.status == 4 %> | ||
<p class="alert alert-warning moderated"> | ||
<% if logged_in_as(['admin','moderator']) %> | ||
<%= t('notes._notes.moderate_first_time_post') %> <br class="hidden-xs hidden-sm"/> | ||
<a class="btn btn-default btn-xs" href="/moderate/publish/<%= like.id %>"><%= t('notes._notes.approve') %></a> | ||
<a class="btn btn-default btn-xs" href="/moderate/spam/<%= like.id %>"><%= t('notes._notes.spam') %></a> | ||
<% else %> | ||
<%= raw t('notes._notes.pending_approval', :url1 => '/wiki/moderation') %> | ||
<% end %> | ||
</p> | ||
<% end %> | ||
|
||
<h3><a <% if @widget %>target="_blank"<% end %> href="<%= like.path %>"><%= (like.type == 'note') ? like.title : like.latest.title %></a></h3> | ||
|
||
<p class="meta"><small> | ||
<% if like.type == 'note' %> | ||
by <a <% if @widget %>target="_blank"<% end %> href="/profile/<%= like.author.name %>"><%= like.author.name %></a> | ||
<%= distance_of_time_in_words(like.created_at, Time.current, { include_seconds: false, scope:'datetime.time_ago_in_words' }) %> | ||
| <a <% if @widget %>target="_blank"<% end %> href="<%= like.path %>#comments"><i style="color:#888;" class="fa fa-comment-o"></i> <%= like.comment_count %></a> | ||
<% else %> | ||
<%= t('notes._notes.last_edit_by') %> <a <% if @widget %>target="_blank"<% end %> href="/profile/<%= like.latest.author.name %>"><%= like.latest.author.name %></a> | ||
<%= distance_of_time_in_words(Time.at(like.latest.timestamp), Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %> | ||
<% end %> | ||
| <i class="fa fa-eye"></i> <%= number_with_delimiter(like.totalviews) %> <span class="hidden-xs hidden-sm"><%= t('notes._notes.views') %></span> | ||
| <i style="<% if like.likes > 0 %>color:#db4;<% else %>color:#888;<% end %>" class="fa fa-star-o"></i> <%= like.likes %> | ||
</small></p> | ||
|
||
<div class="content"> | ||
<% if @compact.nil? %> | ||
<% if params[:action].to_s.include?("methods") %> | ||
<p><small> | ||
<a <% if @widget %>target="_blank"<% end %> href="<%= like.path %>#Activities"><i class="fa fa-flask" style="color:#3da56a;"></i> <%= like.activities.count %> activities</a> | ||
<!-- <p><i class="fa fa-users" style="color:blue"></i> contributors</p> --> | ||
<a <% if @widget %>target="_blank"<% end %> href="<%= like.path %>#Questions"><i class="fa fa-question-circle" style="color:#db3a1e;"></i> <%= like.questions.count %> questions</a> | ||
</small></p> | ||
<% else %> | ||
<p><%= raw strip_tags(sanitize(RDiscount.new(like.body_preview).to_html)) if like.body %></p> | ||
<% end %> | ||
<p> | ||
<% if logged_in_as(['admin','moderator']) %><a class="btn btn-default" href="/moderate/spam/<%= like.id %>"><i class="fa fa-ban"></i> <%= t('notes._notes.spam') %></a><% end %> | ||
<a class="btn btn-default" style="float: right;" href="<%= like.path %>"><%= t('notes._notes.read_more') %></a> | ||
</p> | ||
<% end %> | ||
<% if params[:mod] %> | ||
<a class="btn btn-default" href="#"><i class="fa fa-ban-circle"></i> <%= t('notes._notes.spam') %></a> | ||
<% end %> | ||
<hr style="display:none;" class="bottom" /> | ||
</div> | ||
|
||
</div> | ||
<% unless @widget %><hr class="visible-xs visible-sm" /><% end %> | ||
<% if ((i+1)/4.0).to_i == ((i+1)/4.0) %> | ||
</div> | ||
<% unless @widget %><hr class="visible-xs visible-sm grid" /><% end %> | ||
<div class="row"> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<%= will_paginate @likes, :renderer => BootstrapPagination::Rails unless @unpaginated %> |
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