docbrown/app/views/users/edit.html.erb
Glenn Carremans bcce614a80 Last general linting sweep (#1947)
* Fixed HTML errors in /app/views/additional_content_boxes

* Fixed indentation

* Fixed linting error in /app/views/comments

* Fixed indentation in /app/views/html_variants

* Fixed HTML errors + Fixed indentation in /app/views/internal

* Fixed HTML errors + Fixed indentation in /app/views/layouts

* Fixed indentation in /app/views/mailers

* Fixed indentation in /app/views/moderations

* Fixed HTML errors + Fixed indentation in /app/views/notifications

* Fixed HTML errors in /app/views/pages

* Fixed HTML errors + Fixed indentation in /app/views/social_previews

* Fixed indentation in /app/views/stories

* Fixed indentation in /app/views/stripe_subscriptions

* Fixed indentation in /app/views/tags

* Fixed indentation in /app/views/users
2019-03-02 07:47:14 -08:00

91 lines
2.9 KiB
Text

<% title "Settings" %>
<% if flash[:notice] && flash[:notice].include?("Your ") %>
<div class="notice" id="notice">
<%= flash[:notice] %>
</div>
<% end %>
<% if flash[:error].present? %>
<div class="notice error-notice" id="notice">
<%= flash[:error] %>
</div>
<% end %>
<% if params[:state] == "previous-registration" %>
<div class="notice error-notice" id="notice">
There is an existing account authorized with that social account. Contact
<a href="mailto:yo@dev.to">yo@dev.to</a> if this is a mistake.
</div>
<% end %>
<div class="user-settings-page">
<% if @tab == "organization" && @user.organization.present? %>
<h2>Settings for <a href="/<%= @user.organization.slug %>">@<%= @user.organization.slug %></a></h2>
<% else %>
<h2>Settings for <a href="/<%= @user.username %>">@<%= @user.username %></a></h2>
<% end %>
<% if current_user.email.blank? %>
<div class="finish-notice">
Confirm your email to complete your profile
<div class="small">
while you're at it, go ahead and fill everything out.<br />
<% if @user.twitter_username.blank? %>
connect your twitter account as well to complete your identity.
<% elsif @user.github_username.blank? %>
connect your github account as well to complete your identity.
<% end %>
</div>
</div>
<% end %>
<% if @user.unconfirmed_email.present? %>
<div class="field-notice">
Email Verification
<div class="small">
you have requested a change to
<a href="mailto:<%= @user.unconfirmed_email %>"><%= @user.unconfirmed_email %></a><br />
check your inbox for the verification link to finalize the change.
</div>
</div>
<% end %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited your profile from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<% if @organization && @organization.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@organization.errors.count, "error") %> prohibited your org profile from being saved:</h2>
<ul>
<% @organization.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="settings-hub">
<% @tab_list.each do |possible_tab| %>
<% if @tab == possible_tab.downcase.gsub(" ", "-") %>
<div class="single-settings-tab selected">
<%= possible_tab %>
</div>
<% else %>
<a class="single-settings-tab" href="/settings/<%= possible_tab.downcase.gsub(" ", "-") %>"><%= possible_tab %></a>
<% end %>
<% end %>
</div>
<div class="settings-form">
<%= render "users/" + @tab.gsub("-", "_"), tab: @tab %>
</div>
</div>