forked from saurabh/orbit4-5
59 lines
2.3 KiB
Plaintext
59 lines
2.3 KiB
Plaintext
<%
|
|
current_user_is_group_admin = group.admins.include?(current_user.id.to_s) ? true : false
|
|
if !current_user_is_group_admin
|
|
current_user_is_group_member = group.users.include?(current_user) ? true : false
|
|
else
|
|
current_user_is_group_member = true
|
|
end
|
|
%>
|
|
<li class="group-card animated bounceInDown" data-group-id="<%= group.id.to_s %>">
|
|
<div class="group-card-inner card-ownership <%= current_user_is_group_admin ? "card-owner" : (current_user_is_group_member ? "card-member" : "card-public") %> card">
|
|
<% if current_user_is_group_admin %>
|
|
<div class="group-card-action action">
|
|
<button class="group-card-dropdown-toggle toggle">
|
|
<span class="caret"></span>
|
|
</button>
|
|
<ul class="group-card-dropdown action-dropdown">
|
|
<li class="group-card-dropdown-item">
|
|
<%= link_to(content_tag(:i, nil, :class => 'fa fa-pencil-square-o') + " Edit",edit_admin_group_path(group),:class=>"edit" ) %>
|
|
</li>
|
|
<li class="group-card-dropdown-item">
|
|
<%= link_to(content_tag(:i, nil, :class => 'fa fa-trash-o') + " Delete","/admin/groups/#{group.id.to_s}",:class=>"trash delete-group-button" ) %>
|
|
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|
|
<div class="group-avatar">
|
|
<a href="<%= admin_group_path(group) %>">
|
|
<%= image_tag(group.image) %>
|
|
</a>
|
|
</div>
|
|
<div class="group-info">
|
|
<h4 class="group-name"><%= link_to group.title, admin_group_path(group) %></h4>
|
|
<%
|
|
author = ""
|
|
group.admins.each_with_index do |admin,i|
|
|
user = User.find(admin) rescue nil
|
|
if !user.nil?
|
|
author = author + (user.member_profile.name == nil ? user.user_name : user.member_profile.name rescue "")
|
|
author = author + ", " if i != group.admins.count - 1
|
|
end
|
|
end
|
|
%>
|
|
<div class="group-mail">Admin : <%= author %></div>
|
|
<hr>
|
|
<ul class="group-roles">
|
|
<li class="group-privacy">
|
|
<span class="group-staturs">Privacy : </i>
|
|
<span class="label <%= group.privacy_name %>"><%= group.privacy_name %></span>
|
|
</li>
|
|
<li class="group-description">
|
|
<% content = group.description %>
|
|
<%= content[0..150] %>
|
|
<%= "..." if content.length > 250 %>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</li>
|