Skip to content

Commit

Permalink
Improve formatting for member display
Browse files Browse the repository at this point in the history
  • Loading branch information
valleyjo committed Aug 11, 2015
1 parent 9d231f5 commit 852ccce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
10 changes: 9 additions & 1 deletion app/decorators/user_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ def attendance_count_for_not_required
end

def parent_name
object.parent_id.present? ? User.find(parent_id).name : "[unknown]"
parent_id.present? ? User.find(parent_id).name : "[unknown]"
end

def position_name
if position.present? && position.name.present?
position.name
else
"[none]"
end
end
end
22 changes: 15 additions & 7 deletions app/views/external/members.html.haml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
- provide(:title, "Current Active Members")
%h1 Current Active Members
- @users.each do |u|
.col-md-5.member-listing
%h3= u.name
.col-md-6
.col-md-5.row.member-listing
.col-sm-12
%h3= u.name
.col-sm-6
= image_tag u.avatar.url(:thumb), class: 'img-thumbnail'
%p Family: #{u.division}
%p Class: #{u.extra_info}
%p Big Brother: #{u.parent_name}
%p.col-md-6= u.about
.col-sm-6
%p= u.about
.col-sm-12
%p
<strong> Family: </strong> #{u.division}
%br
<strong> Class: </strong> #{u.extra_info}
%br
<strong> Big Brother: </strong> #{u.parent_name}
%br
<strong> Position: </strong> #{u.position_name}

0 comments on commit 852ccce

Please sign in to comment.