docbrown/app/views/users/edit.html.erb
Mac Siri 0f3342bcec [WIP] Implement non front-matter editor (#415)
* Create alternate editor

* Install linkstate (?)

Not sure how it disappear in the first place

* Run yarn install

* Modulize ArticleForm component

* Refactor

* Isolating css WIP

* Implement simplified frontmatter-less editor

* Modulize individual form element

* Ajust props names

* Transform json params to snakecase

* Remove codes

* Update /new, almost there for release

* Fix editor resize issues

* Change defaultvalue to value in article form tag element

* Modify html buttons in article form
2018-07-27 20:12:33 -07:00

86 lines
2.6 KiB
Text

<% title "Settings - DEV" %>
<% 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 %>
<div class="user-settings-page">
<% if @tab == "organization" && @user.organization.present? %>
<h2>Settings for <a href="/<%= @user.organization.slug %>">@<%= @user.organization.slug %></h2></a>
<% else %>
<h2>Settings for <a href="/<%= @user.username %>">@<%= @user.username %></h2></a>
<% 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>