Sha256: 8d04603550c8906802fd440c38b90949fa4db4dc06d697566b0227cbea36354f

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

<div class='page-header'>
  <h1><%= @user.name %></h1>
</div>

<% followership = @user.followers.where(user_id: current_user.id).first %>
<% if followership %>
  <%= link_to t('followership.unfollow'), [@user, followership], class: 'btn btn-danger', method: :delete %>
<% elsif @user != current_user %>
  <%= link_to t('followership.follow'), user_followerships_path(@user), class: 'btn btn-default', method: :post %>
<% end %>

<%= link_to t('followership.followers'), user_followers_path(@user) %>
<%= link_to t('followership.following'), user_following_path(@user) %>

<p class='lead'>
  <%= simple_format @user.bio %>
</p>

<%= image_tag @user.avatar.medium.url %>

<dl>
  <% if policy(@user).read_field?(:email) %>
    <dt><%= Raddar::User.human_attribute_name('email') %></dt>
    <dd>
      <%= @user.email %>
      <% if @user == current_user && @user.pending_reconfirmation? %>
        <em><%= t '.unconfirmed_email', email: @user.unconfirmed_email %></em>
      <% end %>
    </dd>
  <% end %>

  <% if policy(@user).read_field?(:gender) && @user.gender.present? %>
    <dt><%= Raddar::User.human_attribute_name('gender') %></dt>
    <dd><%= t @user.gender, scope: 'user.gender_options' %></dd>
  <% end %>

  <% if policy(@user).read_field?(:location) && @user.location.present? %>
    <dt><%= Raddar::User.human_attribute_name('location') %></dt>
    <dd><%= @user.location %></dd>
  <% end %>

  <% if policy(@user).read_field?(:birthday) && @user.birthday.present? %>
    <dt><%= Raddar::User.human_attribute_name('birthday') %></dt>
    <dd><%= l @user.birthday %></dd>
  <% end %>
</dl>

<% @user.external_accounts.each do |account| %>
  <% if policy(@user).read_field?(account.provider) %>
    <%= link_to account.provider.titleize, account.url, target: '_blank' %>
  <% end %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
raddar-0.0.1.pre app/views/raddar/users/show.html.erb