Add gravatar picture to header

This commit is contained in:
riggraz
2019-08-19 17:42:13 +02:00
parent 7cae9d68c1
commit 35d55c1e71
6 changed files with 28 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<h2>Profile settings</h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
@@ -11,6 +11,9 @@
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, autocomplete: "email", class: "form-control" %>
<small id="emailGravatarHelp" class="form-text text-muted">
the email is <a href="https://gravatar.com">gravatar</a>ized
</small>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
@@ -53,5 +56,3 @@
<h3>Cancel my account</h3>
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger" %></p>
<%= link_to "Back", :back %>

View File

@@ -18,7 +18,7 @@
<%= f.password_field :password, autocomplete: "new-password", class: "form-control" %>
<% if @minimum_password_length %>
<small id="passwordHelp" class="form-text text-muted">
(<%= @minimum_password_length %> characters minimum)
<%= @minimum_password_length %> characters minimum
</small>
<% end %>
</div>

View File

@@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container">
<%= link_to "Astuto", "#", class: "navbar-brand" %>
<%= link_to "Astuto", root_path, class: "navbar-brand" %>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
@@ -10,7 +10,8 @@
<% if user_signed_in? %>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<%= current_user.full_name %>
<%= image_tag(current_user.gravatar_url, class: "gravatar", alt: current_user.full_name, size: 24) %>
<span class="fullname"><%= current_user.full_name %></span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<%= link_to "Profile settings", edit_user_registration_path, class: "dropdown-item" %>