Skip to content

Commit

Permalink
Applying CSS into edit users form
Browse files Browse the repository at this point in the history
  • Loading branch information
guivinicius committed Apr 21, 2012
1 parent 73f7884 commit e25f4c7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
55 changes: 38 additions & 17 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,46 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>

<div><%= f.label :email %><br />
<%= f.email_field :email %></div>

<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password %></div>

<div><%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %></div>

<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password %></div>

<div><%= f.submit "Update" %></div>
<div class="control-group">
<%= f.label :name, :class => "control-label" %>
<div class="controls">
<%= f.text_field :name %>
</div>
</div>

<div class="control-group">
<%= f.label :email, :class => "control-label" %>
<div class="controls">
<%= f.email_field :email %>
</div>
</div>

<div class="control-group">
<%= f.label :password, :class => "control-label" %>
<div class="controls">
<%= f.password_field :password %>
<p class="help-block">Deixe em branco caso não queira alterar.</p>
</div>
</div>

<div class="control-group">
<%= f.label :password_confirmation, :class => "control-label" %>
<div class="controls">
<%= f.password_field :password_confirmation %>
</div>
</div>

<div class="control-group">
<%= f.label :current_password, :class => "control-label" %>
<div class="controls">
<%= f.password_field :current_password %>
</div>
<p class="help-block">Entre com sua senha atual para confirmar as alterações.</p>
</div>

<%= f.submit "Atualizar", :class => "btn" %>
<% end %>

<h3>Cancel my account</h3>

<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>

<%= link_to "Back", :back %>
3 changes: 2 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<a class="brand" href="#">Tecece</a>
<div class="container nav-collapse">
<ul class="nav">
<li><%= link_to "Alterar Conta", edit_user_registration_path %></li>
<li><%= link_to "Sair", destroy_user_session_path, :method => :delete %></li>
</ul>
</div><!--/.nav-collapse -->
Expand All @@ -43,7 +44,7 @@
<div class="well sidebar-nav">
<ul class="nav nav-list">
<!-- <li class="nav-header"></li> -->
<% @colleges.each do |c| %>
<% College.all.each do |c| %>
<li><%= link_to "#{c.name} (#{c.short})", college_path(c) %></li>
<% end -%>
</ul>
Expand Down

0 comments on commit e25f4c7

Please sign in to comment.