Standartize how we render group rows

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2015-08-26 23:41:56 +02:00
parent e0b4222fa6
commit 5ea5e8f5d6
No known key found for this signature in database
GPG key ID: 161B5D6A44D3D88A
4 changed files with 30 additions and 38 deletions

View file

@ -377,6 +377,7 @@ table {
.center-top-menu {
list-style: none;
text-align: center;
margin-top: 5px;
padding-bottom: 15px;
margin-bottom: 15px;

View file

@ -8,32 +8,9 @@
= link_to new_group_path, class: "btn btn-new btn-sm" do
%i.fa.fa-plus
New Group
.panel.panel-default
.panel-heading
%strong Groups
(#{@group_members.count})
%ul.well-list
- @group_members.each do |group_member|
- group = group_member.group
%li
.pull-right.hidden-xs
- if can?(current_user, :admin_group, group)
= link_to edit_group_path(group), class: "btn-sm btn btn-grouped" do
%i.fa.fa-cogs
Settings
= link_to leave_group_group_members_path(group), data: { confirm: leave_group_message(group.name) }, method: :delete, class: "btn-sm btn btn-grouped", title: 'Leave this group' do
%i.fa.fa-sign-out
Leave
= image_tag group_icon(group), class: "avatar s40 avatar-tile hidden-xs"
= link_to group, class: 'group-name' do
%strong= group.name
as
%strong #{group_member.human_access}
%div.light
#{pluralize(group.projects.count, "project")}, #{pluralize(group.users.count, "user")}
%ul.bordered-list
- @group_members.each do |group_member|
- group = group_member.group
= render 'shared/groups/group', group: group, group_member: group_member
= paginate @group_members

View file

@ -32,17 +32,7 @@
%ul.bordered-list
- @groups.each do |group|
%li
.clearfix
%h4
= link_to group_path(id: group.path) do
= group.name
.clearfix
%p
= truncate group.description, length: 150
.clearfix
%p.light
#{pluralize(group.members.size, 'member')}, #{pluralize(group.projects.count, 'project')}
= render 'shared/groups/group', group: group
- unless @groups.present?
.nothing-here-block No public groups

View file

@ -0,0 +1,24 @@
- group_member = local_assigns[:group_member]
%li
- if group_member
.pull-right.hidden-xs
- if can?(current_user, :admin_group, group)
= link_to edit_group_path(group), class: "btn-sm btn btn-grouped" do
%i.fa.fa-cogs
Settings
= link_to leave_group_group_members_path(group), data: { confirm: leave_group_message(group.name) }, method: :delete, class: "btn-sm btn btn-grouped", title: 'Leave this group' do
%i.fa.fa-sign-out
Leave
= image_tag group_icon(group), class: "avatar s40 avatar-tile hidden-xs"
= link_to group, class: 'group-name' do
%strong= group.name
- if group_member
as
%strong #{group_member.human_access}
%div.light
#{pluralize(group.projects.count, "project")}, #{pluralize(group.users.count, "user")}