forked from saurabh/orbit4-5
131 lines
5.2 KiB
Plaintext
131 lines
5.2 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/wow/1.1.2/wow.min.js" %>
|
|
<%= javascript_include_tag "group.js" %>
|
|
<% end -%>
|
|
<div class="group-post">
|
|
<div class="group-post-banner-wrap">
|
|
<div class="group-post-banner-image-wrap">
|
|
<img class="group-post-banner-image" src="<%= @group.image.url %>" alt="<%= @group.title %>">
|
|
<ul class="group-post-view-switch button-group">
|
|
<li class="group-post-feed-view button button-group-common button-default active tool-tip-parent">
|
|
<span class="tool-tip bottom nowrap">List view</span>
|
|
<a class="group-post-switch-btn" href="#" title="Feed"><i class="icon-list-ul"></i></a>
|
|
</li>
|
|
<li class="group-post-grid-view button button-group-common button-default tool-tip-parent">
|
|
<span class="tool-tip bottom nowrap">Grid view</span>
|
|
<a class="group-post-switch-btn" href="#" title="Grid"><i class="icon-th"></i></a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="group-post-bar">
|
|
<h2 class="group-post-page-title"><%= @group.title %></h2>
|
|
<!-- <a class="group-post-join button button-primary" href="#"> -->
|
|
<i class="fa fa-user-plus"></i>
|
|
Join this group
|
|
<!-- </a> -->
|
|
<% if user_can_write? %>
|
|
<a class="group-post-new-post button button-primary" href="<%= admin_group_newpost_path(@group) %>"><i class="icon-plus"></i> New Post</a>
|
|
<% end %>
|
|
<ul class="group-post-view-switch-in-bar button-group">
|
|
<li class="group-post-feed-view button button-group-common button-default active tool-tip-parent">
|
|
<span class="tool-tip nowrap">List view</span>
|
|
<a class="group-post-switch-btn" href="#" title="Feed"><i class="icon-list-ul"></i></a>
|
|
</li>
|
|
<li class="group-post-grid-view button button-group-common button-default tool-tip-parent">
|
|
<span class="tool-tip nowrap">Grid view</span>
|
|
<a class="group-post-switch-btn" href="#" title="Grid"><i class="icon-th"></i></a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="group-post-section wrapper">
|
|
<div class="group-post-detail">
|
|
<ul class="group-post-pagenation breadcrumb">
|
|
<li><a href="<%= admin_groups_path %>">My Groups</a> <span class="divider">/</span></li>
|
|
<li class="active"><%= @group.title %></li>
|
|
</ul>
|
|
<span class="gorup-page-info-wrap button button-default" id="group_info_button">
|
|
<i class="group-post-info-icon icon-info-sign"></i> <span>Info</span>
|
|
</span>
|
|
<div class="group-post-description-wrap" id="group_info_area" style="display:none;">
|
|
<% if @group.privacy == "closed" %>
|
|
<span class="group-post-status-wrap close-eye button button-activated">
|
|
<i class="group-post-status icon-eye-open"></i> Private
|
|
</span>
|
|
<% else %>
|
|
<span class="group-post-status-wrap open-eye button button-activated">
|
|
<i class="group-post-status icon-eye-open"></i> Public
|
|
</span>
|
|
<% end %>
|
|
<h4 class="muted">Group Description</h4>
|
|
<p class="group-post-description"><%= @group.description %></p>
|
|
<p>
|
|
<% number_of_members = @group.users.count %>
|
|
<% if number_of_members > 0 %>
|
|
<a class="group-post-member-count" href="<%= admin_group_members_path(@group) %>">
|
|
<i class="fa fa-user"></i>
|
|
<%= number_of_members.to_s %> member<%= number_of_members > 1 ? "s" : "" %>
|
|
</a>
|
|
<% else %>
|
|
<span class="group-post-no-member">
|
|
<i class="fa fa-user"></i>
|
|
No members
|
|
</span>
|
|
<% end %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<%= render :partial => "post", :collection => @group.group_posts.desc(:created_at) %>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
(function($) {
|
|
|
|
var group_info_area = $("#group_info_area"),
|
|
orbit_bar = $("#orbit-bar");
|
|
$("#group_info_button").on("click",function(){
|
|
if(!group_info_area.hasClass("expanded")){
|
|
group_info_area.slideDown();
|
|
group_info_area.addClass("expanded");
|
|
}else{
|
|
group_info_area.slideUp();
|
|
group_info_area.removeClass("expanded");
|
|
}
|
|
})
|
|
|
|
$(".delete-post-btn").on("click",function(){
|
|
if(confirm("Are you sure that you want to delete this post?")){
|
|
var el = $(this);
|
|
$.ajax({
|
|
url : el.attr("href"),
|
|
type : "DELETE",
|
|
dataType : "json"
|
|
}).done(function(){
|
|
var id = el.attr("href").split("/");
|
|
id = id[3];
|
|
$("div[data-post-id="+id+"]").slideUp(function(){$(this).remove();});
|
|
})
|
|
}
|
|
return false;
|
|
})
|
|
|
|
$(document).on("scroll",function(){
|
|
|
|
orbit_bar.slideUp();
|
|
|
|
if ( window.pageYOffset === 0 ) {
|
|
orbit_bar.slideDown( 100 );
|
|
}
|
|
|
|
})
|
|
|
|
}(jQuery));
|
|
</script>
|