forked from saurabh/orbit4-5
135 lines
6.4 KiB
Plaintext
135 lines
6.4 KiB
Plaintext
<% content_for :page_specific_css do -%>
|
|
<%= stylesheet_link_tag "lib/group/group-main" %>
|
|
<%= stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" %>
|
|
<%= stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.6/animate.min.css" %>
|
|
<% end -%>
|
|
<% content_for :page_specific_javascript do -%>
|
|
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.min.js" %>
|
|
<%= javascript_include_tag "lib/jquery.form" %>
|
|
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.center.min.js" %>
|
|
<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js" %>
|
|
<%= javascript_include_tag "group.js" %>
|
|
<% end -%>
|
|
|
|
<article class="group-show-post wrapper">
|
|
<ul class="group-page-pagenation breadcrumb">
|
|
<li><a href="<%= admin_groups_path %>">My Groups</a> <span class="divider">/</span></li>
|
|
<li><a href="<%= admin_group_path(@group) %>"><%= @group.title %></a> <span class="divider">/</span></li>
|
|
<li class="active"><%= @post.title %></li>
|
|
</ul>
|
|
<header class="group-show-post-meta">
|
|
<div class="group-show-post-heading-wrap clearfix">
|
|
<h2 class="group-show-post-title"><%= @post.title %></h2>
|
|
<div class="group-show-post-avatar-wrap">
|
|
<a class="group-show-post-avatar-username-toggle tool-tip-parent" href="#">
|
|
<%
|
|
user = User.find(@post.author) rescue nil
|
|
if !user.nil?
|
|
author = (user.member_profile.name == nil ? user.user_name : user.member_profile.name rescue "")
|
|
avatar = (!user.member_profile.avatar.nil? ? user.member_profile.avatar.thumb.url : "/assets/member-pic.png" rescue "/assets/member-pic.png")
|
|
end
|
|
%>
|
|
<img class="group-show-post-avatar" src="<%= avatar %>" alt="">
|
|
<span class="group-show-post-username tool-tip"><%= author %></span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="group-show-post-sub-wrap">
|
|
<span class="group-show-post-postdate">
|
|
<% date = DateTime.parse(@post.created_at.to_s).strftime("%d %B %H:%M ") %>
|
|
<i class="group-show-post-postdate-icon icon-time"></i> <%= date %>
|
|
</span>
|
|
<!-- <span class="group-show-post-time">10:25</span> -->
|
|
</div>
|
|
</header>
|
|
<section class="group-show-post-image-wrap">
|
|
<ul class="group-show-post-image-list cycle-slideshow"
|
|
data-cycle-slides="li"
|
|
data-cycle-prev=".group-show-post-cycle-prev"
|
|
data-cycle-next=".group-show-post-cycle-next"
|
|
data-cycle-fx="fade"
|
|
data-cycle-log="false"
|
|
data-cycle-center-horz=true
|
|
data-cycle-center-vert=true
|
|
>
|
|
<% @post.group_post_images.each do |gpi| %>
|
|
<li class="group-show-post-image-item"><img class="group-show-post-banner-image" src="<%= gpi.image.url %>" alt="<%= @post.title %>"></li>
|
|
<% end %>
|
|
</ul>
|
|
<div class="group-show-post-cycle-prev cycle-nav"><i class="group-show-post-cycle-nav-icon icon-chevron-left"></i></div>
|
|
<div class="group-show-post-cycle-next cycle-nav"><i class="group-show-post-cycle-nav-icon icon-chevron-right"></i></div>
|
|
</section>
|
|
<section class="group-show-post-content">
|
|
<%= @post.content.html_safe %>
|
|
</section>
|
|
<div class="group-show-post-attachment-wrap">
|
|
<% if !@post.group_post_files.blank? %>
|
|
<span class="group-show-post-attachments">
|
|
<% @post.group_post_files.each do |gpf| %>
|
|
<a href="/admin/posts/file/<%= gpf.id.to_s %>" class="button button-primary button-small"><i class="group-show-post-attachment-file-format fa fa-file-image-o"></i><span class="group-show-post-attachments-file-name"><%= File.basename(gpf.file.path) %></span></a>
|
|
<% end %>
|
|
</span>
|
|
<% end %>
|
|
</div>
|
|
<% if !@read_by_names.blank? %>
|
|
<div class="group-show-post-seen-by tool-tip-parent">
|
|
<i class="fa fa-eye"></i>
|
|
<em class="group-show-post-seen-by-lead">Seen by: <span class="group-show-post-seen-by-count"><%= @read_by_names.count %></span></em>
|
|
<div class="gorup-post-seen-by-names tool-tip right">
|
|
<% @read_by_names.each do |name| %>
|
|
<span class="group-show-post-seen-by-name"><%= name %></span>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<section class="comments">
|
|
<% if user_can_write? %>
|
|
<div class="group-show-post-respond">
|
|
<form action="/admin/posts/comment" method="post" id="comment-form" >
|
|
<h3 class="group-show-post-respond-title">
|
|
Leave a comment
|
|
</h3>
|
|
<div class="group-show-post-respond-wrap">
|
|
<label for="comment" class="screen-reader">Comment</label>
|
|
<input type="text" name="group_post_comment[comment]" id="group_post_comment" class="group-show-post-respond-comment" placeholder="Your comment here.">
|
|
<input type="hidden" name="group_post_comment[group_post_id]" value="<%= @post.id.to_s %>" />
|
|
<input type="hidden" name="group_post_comment[user_id]" value="<%= current_user.id.to_s %>" />
|
|
</div>
|
|
<div class="group-show-post-submit-wrap">
|
|
<input type="submit" name="submit" class="group-show-post-respond-submit button button-primary" id="submit" value="Submit Comment">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<% else %>
|
|
<div class="group-show-post-respond wow bounceInLeft">
|
|
<h4 class="group-no-permission"><i class="fa fa-exclamation-triangle"></i>Join the group to comment on this post.</h4>
|
|
</div>
|
|
<% end %>
|
|
<h3 class="group-show-post-comment-title bounceIn">
|
|
Comments
|
|
</h3>
|
|
<ol class="group-show-post-comment-list" id="group-show-post-comment-list" >
|
|
<%= render :partial => "post_comment", :collection => @post.group_post_comments.desc(:created_at) %>
|
|
<% if @post.group_post_comments.length == 0 %>
|
|
<li id="no-comments-li" class="group-show-post-no-comment"> No comments yet. <%= (user_can_write? ? "Be the first one!" : "") %> </li>
|
|
<% end %>
|
|
</ol>
|
|
</section>
|
|
</article>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$("#comment-form").ajaxForm({
|
|
beforeSubmit : function(formData){
|
|
if(formData[0].value == ""){
|
|
return false;
|
|
}
|
|
},
|
|
success : function(comments){
|
|
$("li#no-comments-li").remove();
|
|
$("ol#group-show-post-comment-list").prepend(comments);
|
|
$("#comment-form").resetForm();
|
|
}
|
|
})
|
|
</script>
|