User: show github username in profile

This commit is contained in:
Carl Chenet 2017-05-20 14:06:20 +02:00
parent 56135da720
commit cd554c410c
2 changed files with 17 additions and 1 deletions

View file

@ -115,7 +115,13 @@ class User < ActiveRecord::Base
attrs.push :about
h = super(:only => attrs)
h[:avatar_url] = avatar_url
h[:avatar_url] = self.avatar_url
if self.github_username.present?
h[:github_username] = self.github_username
end
h
end

View file

@ -115,6 +115,16 @@
</span>
<br>
<% if @showing_user.github_username.present? %>
<label class="required">GitHub:</label>
<span class="d">
<a href="https://github.com/<%= h(@showing_user.github_username)
%>">https://github.com/<%= h(@showing_user.github_username) %></a>
</span>
<br>
<% end %>
<% if @showing_user.is_active? %>
<label class="required"><%= t('.about') %></label>