app/views/dashboard/home.html.erb
<% if current_user.confirmed %>
<% if flash.present? %>
<% flash.each do | name | %>
<div class="flash-mail">
<i class="material-icons close-flash">close</i>
<p><%= name.last %></p>
</div>
<% end %>
<% end %>
<main>
<section class="main container center-align">
<div class="row">
<section class="col s6">
<div class="user_info">
<h3>Welcome <%= "#{current_user.firstname} #{current_user.lastname}" %> </h3>
<% if current_user.artisan? && current_user.status != "accepted" && current_user.latest_response %>
<h5>view application submitted</h5>
<%= form_tag users_response_path(current_user.latest_response), method: "get" do %>
<button id='notification' class="waves-effect waves-light btn"> view </button>
<% end %>
<% end %>
<h5>enable mail notifications</h5>
<%= form_tag user_settings_path do %>
<div class="switch" style="padding: 2em;">
<label>
Off
<% if current_user.enable_notifications %>
<%= check_box_tag "notifications_enabled", "on", true %>
<% else %>
<%= check_box_tag "notifications_enabled", "off", false %>
<% end %>
<span class="lever"></span>
On
</label>
</div>
<button id='notification' class="waves-effect waves-light btn"> save </button>
</div>
<% end %>
</section>
<section class="col s6">
<div class="profile-meter">
<div class="progress-pie-chart" data-percent="<%= @completion_percentage %>">
<div class="ppc-progress">
<div class="ppc-progress-fill"></div>
</div>
<div class="ppc-percents">
<div class="pcc-percents-wrapper">
<span>%</span>
</div>
</div>
</div>
<p class="meter-header"><a href="<%= profile_path %>"> Complete Your Profile</a> </p>
</div>
</section>
</div>
</section>
</main>
<% else %>
<main>
<section class="confirm-mail-first container">
<div class="row">
<div class="col s12">
<div class="user_info card">
<h5>Confirm your email address</h5>
<p>
To continue, please click on the link sent to
<strong><%= current_user.email %></strong>
This will help to validate your account.
</p>
<%= link_to "Resend Confirmation Link", resend_mail_path, method: :post %>
</div>
</div>
</div>
</section>
</main>
<% end %>