diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-10-16 23:59:23 +0200 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-10-17 00:01:46 +0200 |
commit | 27323b75fca480caa9055017cb86e87f35de057e (patch) | |
tree | c640d2643d740adb8beec1a81021200f3a6671f4 | |
parent | 97abb997732314696756aea12e3a2a74f6a7cca9 (diff) | |
download | ecs2-27323b75fca480caa9055017cb86e87f35de057e.tar.gz ecs2-27323b75fca480caa9055017cb86e87f35de057e.zip |
Adding mid in listing of participants for community.
-rw-r--r-- | app/models/participant.rb | 5 | ||||
-rw-r--r-- | app/views/admin/communities/show.html.haml | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/models/participant.rb b/app/models/participant.rb index f2ffb17..c9f6746 100644 --- a/app/models/participant.rb +++ b/app/models/participant.rb @@ -83,6 +83,11 @@ class Participant < ActiveRecord::Base participant.save end + + def mid(community) + Membership.for_participant_id_and_community_id(self, community.id).first.id + end + private def garbage_collect diff --git a/app/views/admin/communities/show.html.haml b/app/views/admin/communities/show.html.haml index 7a8f4b2..490da43 100644 --- a/app/views/admin/communities/show.html.haml +++ b/app/views/admin/communities/show.html.haml @@ -40,18 +40,20 @@ %p .show-output-width.table-border .table-header - %label.table-resource-label Participants joining this community: + %label.table-resource-label Participants joining the community: %table.list(width="100%") %tr(align="left") %th ID: %th Name: %th Description: + %th(align="right") MembershipID (mid): - participants.each do |participant| %tr{:class => [cycle('list-line-odd', 'list-line-even')]} %td= link_to h(participant.id), admin_participant_path(participant) %td= participant.name %td= h(participant.description).gsub(/\r\n/, '<BR>') + %td(align="right")= participant.mid(@community) %p = link_to 'Edit', edit_admin_community_url(:id => @community) |