houdini/app/views/profiles/show.html.erb

63 lines
2.2 KiB
Text
Raw Normal View History

2020-06-12 20:03:43 +00:00
<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE -%>
<% content_for :title_suffix do %>
- Donor Profile
<% end %>
<%= content_for :javascripts do %>
<%= javascript_pack_tag 'i18n', 'page__profiles__show'%>
<% end %>
<% content_for :stylesheets do %>
<%= stylesheet_link_tag 'profiles/show/page' %>
<% end %>
<header class='donorProfileHeader stripe--blue'>
<div class='container'>
<table>
<tr>
<td>
<span class='donorProfileHeader-photo' style="background-image: url('<%= @profile.picture.attached? && url_for(@profile.picture_by_size(:normal)) %>');"></span>
</td>
<td class='u-paddingLeft--15'>
<% supporter = (@profile.supporters && @profile.supporters.length != 0) ? supporter : false %>
<% if supporter %>
<h3 class='u-marginBottom--5'><%= supporter.name ? supporter.name : supporter.email %></h3>
<% else %>
<h3 class='u-marginBottom--5'><%= @profile.name ? @profile.name : @profile.email %></h3>
<% end %>
<% if supporter && supporter.city %>
<small>
<strong><%= Format::Address.city_and_state(supporter.city, supporter.state_code) %></strong>
</small>
<% elsif @profile.city %>
<small>
<strong><%= Format::Address.city_and_state(@profile.city, @profile.state_code) %></strong>
</small>
<% end %>
<% if @profile.mini_bio %>
<p class='u-marginTop--10'><%= @profile.mini_bio %></p>
<% end %>
</td>
</tr>
</table>
<% if current_role?(:super_admin) || (current_user && current_user.profile == @profile) %>
<%= render 'profile_tabs', profile_id: @profile.id, active: :profile %>
<a class='button--tiny edit absolute' href='/settings?p=user-profile-edit&s=settings-pane'>
<i class='fa fa-pencil'></i> Edit Profile
</a>
<% end %>
</div>
</header>
<main class='container u-marginBottom--30'>
<%= render 'supported_nonprofits' %>
<section class='u-padding--15'>
<h5 class='u-centered'>Supported Campaigns</h5>
<% if @campaigns.empty? %>
<p class='noResults'>None currently</p>
<% else %>
<%= render 'campaigns/campaigns_table', campaigns: @campaigns %>
<% end %>
</section>
</main>