Skip to content

Commit

Permalink
Corrected for removal of intermediate User object
Browse files Browse the repository at this point in the history
  • Loading branch information
johntopleyons committed Apr 3, 2023
1 parent 429a730 commit 98539c4
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions webapp/views/member.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,51 @@
</section>
<% else %>
<section class="column left">
<p><img class="avatar-large" src="<%= member.enterprise.members.nodes.first.user.avatar_url %>"></p>
<p><img class="avatar-large" src="<%= member.enterprise.members.nodes.first.avatar_url %>"></p>

<% unless member.enterprise.members.nodes.first.user.name.nil? %>
<h2><%=h member.enterprise.members.nodes.first.user.name %></h2>
<p id="login"><%=h member.enterprise.members.nodes.first.user.login %> (<%=h member.enterprise.members.nodes.first.user.database_id %>)</p>
<% unless member.enterprise.members.nodes.first.name.nil? %>
<h2><%=h member.enterprise.members.nodes.first.name %></h2>
<p id="login"><%=h member.enterprise.members.nodes.first.login %> (<%=h member.enterprise.members.nodes.first.database_id %>)</p>
<% else %>
<p id="login-only"><%=h member.enterprise.members.nodes.first.user.login %> (<%=h member.enterprise.members.nodes.first.user.database_id %>)</p>
<p id="login-only"><%=h member.enterprise.members.nodes.first.login %> (<%=h member.enterprise.members.nodes.first.database_id %>)</p>
<% end %>

<% unless member.enterprise.members.nodes.first.user.bio.nil? %>
<p id="bio"><%=h member.enterprise.members.nodes.first.user.bio %></p>
<% unless member.enterprise.members.nodes.first.bio.nil? %>
<p id="bio"><%=h member.enterprise.members.nodes.first.bio %></p>
<% end %>

<p id="profile-stats"><img src="/svg/followers.svg" alt="Followers"> <%=pluralise(member.enterprise.members.nodes.first.user.followers.total_count, 'follower') %> &bull; <%=n member.enterprise.members.nodes.first.user.following.total_count %> following &bull; <img src="/svg/star.svg" alt="Starred"> <%=n member.enterprise.members.nodes.first.user.starred_repositories.total_count %></p>
<p id="profile-stats"><img src="/svg/followers.svg" alt="Followers"> <%=pluralise(member.enterprise.members.nodes.first.followers.total_count, 'follower') %> &bull; <%=n member.enterprise.members.nodes.first.following.total_count %> following &bull; <img src="/svg/star.svg" alt="Starred"> <%=n member.enterprise.members.nodes.first.starred_repositories.total_count %></p>

<section class="profile-detail">
<% if owner %>
<p><img src="/svg/github.svg" alt="GitHub"> GitHub organisation owner</p>
<% end %>

<% unless member.enterprise.members.nodes.first.user.company.nil? || member.enterprise.members.nodes.first.user.company.empty? %>
<p><img src="/svg/company.svg" alt="Company"> <%=h member.enterprise.members.nodes.first.user.company %></p>
<% unless member.enterprise.members.nodes.first.company.nil? || member.enterprise.members.nodes.first.company.empty? %>
<p><img src="/svg/company.svg" alt="Company"> <%=h member.enterprise.members.nodes.first.company %></p>
<% end %>

<% unless member.enterprise.members.nodes.first.user.location.nil? || member.enterprise.members.nodes.first.user.location.empty? %>
<p><img src="/svg/location.svg" alt="Location"> <%=h member.enterprise.members.nodes.first.user.location %></p>
<% unless member.enterprise.members.nodes.first.location.nil? || member.enterprise.members.nodes.first.location.empty? %>
<p><img src="/svg/location.svg" alt="Location"> <%=h member.enterprise.members.nodes.first.location %></p>
<% end %>

<% unless member.enterprise.members.nodes.first.user.email.nil? || member.enterprise.members.nodes.first.user.email.empty? %>
<p><img src="/svg/email.svg" alt="Email"> <a href="mailto:<%=h member.enterprise.members.nodes.first.user.email %>"><%=h member.enterprise.members.nodes.first.user.email %></a></p>
<% unless member.enterprise.members.nodes.first.email.nil? || member.enterprise.members.nodes.first.email.empty? %>
<p><img src="/svg/email.svg" alt="Email"> <a href="mailto:<%=h member.enterprise.members.nodes.first.email %>"><%=h member.enterprise.members.nodes.first.email %></a></p>
<% end %>

<% unless member.enterprise.members.nodes.first.user.twitter_username.nil? || member.enterprise.members.nodes.first.user.twitter_username.empty? %>
<p><img src="/svg/twitter.svg" alt="Twitter"> <a href="https://twitter.com/<%=h member.enterprise.members.nodes.first.user.twitter_username %>">@<%=h member.enterprise.members.nodes.first.user.twitter_username %></a></p>
<% unless member.enterprise.members.nodes.first.twitter_username.nil? || member.enterprise.members.nodes.first.twitter_username.empty? %>
<p><img src="/svg/twitter.svg" alt="Twitter"> <a href="https://twitter.com/<%=h member.enterprise.members.nodes.first.twitter_username %>">@<%=h member.enterprise.members.nodes.first.twitter_username %></a></p>
<% end %>

<% unless member.enterprise.members.nodes.first.user.website_url.nil? || member.enterprise.members.nodes.first.user.website_url.empty? %>
<p><img src="/svg/website.svg" alt="Website"> <a href="<%= website_link(member.enterprise.members.nodes.first.user.website_url) %>"><%=h member.enterprise.members.nodes.first.user.website_url %></a></p>
<% unless member.enterprise.members.nodes.first.website_url.nil? || member.enterprise.members.nodes.first.website_url.empty? %>
<p><img src="/svg/website.svg" alt="Website"> <a href="<%= website_link(member.enterprise.members.nodes.first.website_url) %>"><%=h member.enterprise.members.nodes.first.website_url %></a></p>
<% end %>

<% unless member.organization.saml_identity_provider.nil? || member.organization.saml_identity_provider.external_identities.nodes.empty? %>
<p><img src="/svg/lock.svg" alt="SSO identity"> SSO identity: <%=h member.organization.saml_identity_provider.external_identities.nodes.first.saml_identity.name_id %></p>
<% end %>

<p><img src="/svg/github.svg" alt="GitHub"> <a href="<%=h member.enterprise.members.nodes.first.user.url %>">View on GitHub</a></p>
<p><img src="/svg/github.svg" alt="GitHub"> <a href="<%=h member.enterprise.members.nodes.first.url %>">View on GitHub</a></p>
</section>
<section id="contributions">
<ul class="no-bullets">
Expand All @@ -76,16 +76,16 @@
</ul>
</section>
<section class="profile-dates">
<p><span>Created:</span><%=d member.enterprise.members.nodes.first.user.created_at %></p>
<p><span>Updated:</span><%=d member.enterprise.members.nodes.first.user.updated_at %></p>
<p><% if member.enterprise.members.nodes.first.user.contributions_collection.has_any_contributions %>This user has contributions within the last year. <img src="/svg/tick.svg" alt="Tick"><% else %>This user doesn’t have contributions within the last year. <img src="/svg/cross.svg" alt="Cross"><% end %></p>
<p><span>Created:</span><%=d member.enterprise.members.nodes.first.created_at %></p>
<p><span>Updated:</span><%=d member.enterprise.members.nodes.first.updated_at %></p>
<p><% if member.enterprise.members.nodes.first.contributions_collection.has_any_contributions %>This user has contributions within the last year. <img src="/svg/tick.svg" alt="Tick"><% else %>This user doesn’t have contributions within the last year. <img src="/svg/cross.svg" alt="Cross"><% end %></p>
<p><% if two_factor_disabled %>This user doesn’t have two-factor security enabled. <img src="/svg/cross.svg" alt="Cross"><% else %>This user has two-factor security enabled. <img src="/svg/tick.svg" alt="Tick"><% end %></p>
</section>

<h3>Organisations</h3>
<section id="organisations">
<ul class="no-bullets">
<% member.enterprise.members.nodes.first.user.organizations.nodes.sort_by(&:name).each do |organisation| %>
<% member.enterprise.members.nodes.first.organizations.nodes.sort_by(&:name).each do |organisation| %>
<li><img class="avatar-medium" src="<%=h organisation.avatar_url %>" alt="<%=h organisation.name %>"> <% if member.organization.name.eql?(organisation.name) %><a href="/"><%=h organisation.name %></a><% else %><%=h organisation.name %><% end %></li>
<% end %>
</ul>
Expand All @@ -110,9 +110,9 @@
</section>
<h2>Top Repositories</h2>
<section class="repositories">
<% if member.enterprise.members.nodes.first.user.top_repositories.nodes.any? %>
<% if member.enterprise.members.nodes.first.top_repositories.nodes.any? %>
<ul class="no-bullets">
<% member.enterprise.members.nodes.first.user.top_repositories.nodes.each do |repo| %>
<% member.enterprise.members.nodes.first.top_repositories.nodes.each do |repo| %>
<li><a href="/repositories/<%=h repo.name %>"><img src="/svg/respository.svg" alt="Respository"> <%=h repo.name %></a> <% if repo.is_private %><span class="note">Private</span><% end %></li>
<% end %>
</ul>
Expand Down

0 comments on commit 98539c4

Please sign in to comment.