orbit4-5/app/views/admin/groups/_post.html.erb

50 lines
1.6 KiB
Plaintext

<div class="group-post-item card clearfix wow bounceInUp">
<a href="/admin/posts/<%= post.to_param %>" class="group-post-link"></a>
<div class="group-post-actions tool-tip-parent">
<div class="group-post-action-hint tool-tip right">
<span>Edit this post</span>
</div>
<button class="group-post-dropdown-toggle">
<span class="caret"></span>
</button>
<ul class="group-post-dropdown">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
</ul>
</div>
<div class="group-post-image-wrap">
<% if !post.group_post_images.blank? %>
<img class="group-post-image" src="<%= post.group_post_images.first.image.thumb.url %>" alt="<%= post.title %>">
<% else %>
<img class="group-post-image" src="/assets/no-image.jpg" alt="Post image">
<% end %>
</div>
<div class="group-post-content-wrap">
<h3 class="group-post-title">
<%= post.title %>
</h3>
<div class="group-post-content">
<% content = strip_tags post.content %>
<%= content[0..250] %>
<%= "..." if content.length > 350 %>
</div>
<div class="group-post-meta-wrap">
<span class="group-post-author">
<%
user = User.find(post.author) rescue nil
if !user.nil?
author = (user.member_profile.name == nil ? user.user_name : user.member_profile.name rescue "")
%>
<i class="group-post-author-icon icon-user"></i> <%= author %>
<% end %>
</span>
<div class="group-post-sub-wrap">
<span class="group-post-postdate">
<% date = DateTime.parse(post.created_at.to_s).strftime("%d %B %H:%M") %>
<i class="group-post-postdate-icon icon-time"></i> <%= date %>
</span>
</div>
</div>
</div>
</div>