Open-Source-Access-Control-.../app/views/users/show.html.erb

147 lines
3.8 KiB
Plaintext

<h2>
<%= image_tag @user.gravatar_url(:default => "http://members.heatsynclabs.org/assets/nil.png"), :class => 'avatar-large' %>
<%= @user.name %>
<%= raw(@user.member_status_symbol) %>
<%= link_to image_tag('/twitter.png', :class => 'social-icon', :title => "Twitter"), @user.twitter_url, :class => 'social-link' if @user.twitter_url.present? %>
<%= link_to image_tag('/facebook.png', :class => 'social-icon', :title => "Facebook"), @user.facebook_url, :class => 'social-link' if @user.facebook_url.present? %>
<%= link_to image_tag('/github.png', :class => 'social-icon', :title => "Github"), @user.github_url, :class => 'social-link' if @user.github_url.present? %>
<%= link_to image_tag('/website.png', :class => 'social-icon', :title => "Website"), @user.website_url, :class => 'social-link' if @user.website_url.present? %>
</h2>
<% if current_user.admin? || @user.email_visible %>
<p>
<b>Email:</b>
<%= @user.email %>
</p>
<% end %>
<% if current_user.admin? || @user.phone_visible %>
<p>
<b>Phone:</b>
<%= @user.phone %>
</p>
<% end %>
<p>
<b>Current Skills:</b>
<%= simple_format @user.current_skills %>
</p>
<p>
<b>Desired Skills:</b>
<%= simple_format @user.desired_skills %>
</p>
<% if current_user.admin? then %>
<p>
<b>Orientation?</b>
<%= @user.orientation.strftime("%B %d %Y") unless @user.orientation.blank? %>
</p>
<p>
<b>Emergency Name:</b>
<%= @user.emergency_name %>
</p>
<p>
<b>Emergency Phone:</b>
<%= @user.emergency_phone %>
</p>
<p>
<b>Emergency Email:</b>
<%= @user.emergency_email %>
</p>
<p>
<b>Desired Member Level:</b>
<%= @user.member_level_string %>
</p>
<p>
<b>Payment Method:</b>
<%= @user.payment_method %>
</p>
<p>
<b>Payee:</b>
<%= @user.payee %>
</p>
<% end %>
<% if current_user.admin? then %>
<p>
<b>Found HeatSync via:</b>
<%= simple_format @user.marketing_source %>
</p>
<p>
<b>Left HeatSync because:</b>
<%= simple_format @user.exit_reason %>
</p>
<% end %>
<b>Certifications: </b><%= link_to "+ Add", (new_user_certification_path+"?user="+@user.id.to_s), :class => 'btn' if can? :create, UserCertification %>
<ul>
<% @user.certifications.each do |certification| %>
<li><%= link_to certification.name, certification %></li>
<% end %>
<% if @user.certifications.blank? %><li>n/a</li><% end %>
</ul>
<p>
<b>Card: </b><%= link_to "+ Add", (new_card_path+"?user="+@user.id.to_s), :class => 'btn' if can? :create, Card %>
<% if current_user.admin? then %>
<ul>
<% @user.cards.each do |c| %>
<li><%= link_to c.card_number, c %><%= "," unless c == @user.cards.last %></li>
<% end %>
</ul>
<% else %>
<%= unless @user.cards.blank? then raw("&#x2713;") end %>
<% end %>
</p>
<b>Computers: </b><%= link_to "+ Add", new_mac_path, :class => 'btn' if can? :create, Mac %>
<ul>
<% @user.macs.each do |mac| %>
<li><%= link_to mac.mac, mac %></li>
<% end %>
<% if @user.macs.blank? %><li>n/a</li><% end %>
</ul>
<p>
<% if current_user.admin? then %>
<b>Payments:</b>
<ul>
<% @payments.each do |payment| %>
<li><%= link_to payment.date, payment %></li>
<% end %>
</ul>
<% else %>
<b>Last Payment:</b>
<% last_payment = @user.delinquency %>
<% if last_payment < 30 %>
Less than a month ago
<% else %>
<%= last_payment/30 %> months ago
<% end %>
<% end %>
</p>
<p>
<b>Waiver?</b>
<%= @user.waiver.strftime("%B %d %Y") unless @user.waiver.blank? %>
</p>
<p>
<b>Instructor?</b>
<%= @user.instructor? %>
</p>
<% if current_user.admin? then %>
<p>
<b>Created:</b>
<%= @user.created_at %>
</p>
<p>
<b>Last signed in:</b>
<%= @user.current_sign_in_at %>
</p>
<% end %>
<% if can? :update, @user then %><%= link_to 'Edit', edit_user_path(@user) %> |<% end %>
<%= link_to 'Back', users_path %>