Skip to content

Commit

Permalink
some quick style fixes to profile page; hide some profile tabs before…
Browse files Browse the repository at this point in the history
… registration complete
  • Loading branch information
jpslav committed Dec 23, 2015
1 parent 2a83226 commit ce0db37
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 62 deletions.
11 changes: 11 additions & 0 deletions app/assets/stylesheets/main.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,15 @@ form .nowrap label { white-space: nowrap; }
input.finish-sign-up {
float: right;
clear: both;
margin-top: 6px;
}

.your-account {
tr.contact-info:first-child td {
border-top: none;
}

.add-email-address {
margin-top: 30px;
}
}
12 changes: 6 additions & 6 deletions app/views/contact_infos/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
%>
<%= lev_form_for :contact_info, url: contact_infos_path,
html: {class: 'form-horizontal'} do |f| %>
html: {class: 'form-horizontal add-email-address'} do |f| %>
<%= f.hidden_field :type, value: type %>
<div class="row">
<span class="col-sm-9">
<%= f.label :value, humanized_name %>
<span class="col-sm-11">
<%= f.label :value, "Add an email address" %>
</span>
</div>

<div class="row">
<span class="col-sm-9">
<span class="col-sm-11">
<%= f.text_field :value %>
</span>

<span class="col-sm-3">
<%= f.submit "Add #{humanized_name}",
<span class="col-sm-1">
<%= f.submit "Add",
class: 'standard' %>
</span>
</div>
Expand Down
28 changes: 16 additions & 12 deletions app/views/contact_infos/_show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@
humanized_name = contact_info.type.underscore.humanize
%>

<tr>
<tr class='contact-info'>
<td><%= contact_info.value %></td>
<td><%= contact_info.is_searchable ? 'Searchable' : 'Not searchable' %></td>
<td><%= button_to 'Toggle',
<td><%= contact_info.is_searchable ? 'Searchable' : 'Not Searchable' %> (<%= link_to 'Change',
toggle_is_searchable_contact_info_path(contact_info),
method: :put, class: "standard" %></td>
<td><%= contact_info.verified ? 'Verified' : 'Unverified' %></td>
<td><%= button_to "Resend Verification",
resend_confirmation_contact_info_path(contact_info),
method: :put,
class: "standard" unless contact_info.verified %></td>
<td><%= button_to "Delete",
method: :put %>)</td>

<td>
<% if contact_info.verified %>
Verified
<% else %>
<%= link_to "Click to verify",
resend_confirmation_contact_info_path(contact_info),
method: :put %>
<% end %>
</td>

<td><%= link_to "Delete",
contact_info_path(contact_info),
method: :delete,
confirm: "Are you sure you want to delete \"#{contact_info.value}?\"",
class: "standard" %></td>
confirm: "Are you sure you want to delete \"#{contact_info.value}?\"" %></td>
</tr>
44 changes: 26 additions & 18 deletions app/views/identities/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,36 @@
# identity
%>
<%= form_for identity, url: identity_path,
html: {class: 'form-horizontal'} do |f| %>
<div class="row">
<% if identity.user.is_activated? %>
<div class="col-sm-3">
<%= f.label :current_password, "Current Password" %>
<%= f.password_field :current_password %>
</div>
<%= form_for identity, url: identity_path,
html: {class: 'form-horizontal'} do |f| %>
<div class="row">

<div class="col-sm-3">
<%= f.label :password, "New Password" %>
<%= f.password_field :password %>
</div>
<div class="col-sm-3">
<%= f.label :current_password, "Current Password" %>
<%= f.password_field :current_password %>
</div>

<div class="col-sm-3 nowrap">
<%= f.label :password_confirmation, "New Password Confirmation" %>
<%= f.password_field :password_confirmation %>
</div>
<div class="col-sm-3">
<%= f.label :password, "New Password" %>
<%= f.password_field :password %>
</div>

<div class="col-sm-3 nowrap">
<%= f.label :password_confirmation, "New Password Confirmation" %>
<%= f.password_field :password_confirmation %>
</div>

<div class="horizontal-submit col-sm-3">
<%= f.submit "Change Password", class: 'standard' %>
</div>

<div class="horizontal-submit col-sm-3">
<%= f.submit "Change Password", class: 'standard' %>
</div>
<% end %>
</div>
<% else %>
<div class="well">
These options will be available after you have clicked the button in the upper right to finish sign up.
</div>
<% end %>
3 changes: 2 additions & 1 deletion app/views/layouts/application_body_nav.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<%# Copyright 2011-2013 Rice University. Licensed under the Affero General Public
<%# Copyright 2011-2013 Rice University. Licensed under the Affero General Public
License version 3 or later. See the COPYRIGHT file for details. %>
<% content_for :application_body do %>

<div id="application-body-nav">

<div id="application-body-nav-body">
<%= yield :above_page_heading %>
<%= yield :page_heading %>
<%= yield %>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/views/layouts/application_body_only.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<%# Copyright 2011-2013 Rice University. Licensed under the Affero General Public
<%# Copyright 2011-2013 Rice University. Licensed under the Affero General Public
License version 3 or later. See the COPYRIGHT file for details. %>
<% content_for :application_body do %>

<div id="application-body-only">

<div id="application-body-only-body">
<%= yield :above_page_heading %>
<%= yield :page_heading %>
<%= yield %>
</div>
Expand Down
52 changes: 30 additions & 22 deletions app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,42 @@
# user
%>
<%= form_for user, url: profile_path, html: {class: 'form-horizontal profile-edit'} do |f| %>
<div class="row">
<% if user.is_activated? %>
<div class="col-sm-1">
<%= f.label :title, "Title" %>
<%= f.text_field :title %>
</div>
<%= form_for user, url: profile_path, html: {class: 'form-horizontal profile-edit'} do |f| %>
<div class="row">

<div class="col-sm-3">
<%= f.label :first_name, "First Name" %>
<%= f.text_field :first_name, value: user.first_name || \
user.guessed_first_name %>
</div>
<div class="col-sm-1">
<%= f.label :title, "Title" %>
<%= f.text_field :title %>
</div>

<div class="col-sm-3">
<%= f.label :last_name, "Last Name" %>
<%= f.text_field :last_name, value: user.last_name || \
user.guessed_last_name %>
</div>
<div class="col-sm-3">
<%= f.label :first_name, "First Name" %>
<%= f.text_field :first_name, value: user.first_name || \
user.guessed_first_name %>
</div>

<div class="col-sm-2">
<%= f.label :suffix, 'Suffix' %>
<%= f.text_field :suffix, value: user.suffix %>
</div>
<div class="col-sm-3">
<%= f.label :last_name, "Last Name" %>
<%= f.text_field :last_name, value: user.last_name || \
user.guessed_last_name %>
</div>

<div class="col-sm-2">
<%= f.label :suffix, 'Suffix' %>
<%= f.text_field :suffix, value: user.suffix %>
</div>

<div class="horizontal-submit col-sm-3">
<%= f.submit "Update Profile", class: 'standard' %>
</div>

<div class="horizontal-submit col-sm-3">
<%= f.submit "Update Profile", class: 'standard' %>
</div>
<% end %>
<% else %>
<div class="well">
These options will be available after you have clicked the button in the upper right to finish sign up.
</div>
<% end %>
10 changes: 8 additions & 2 deletions app/views/users/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<%= page_heading("Your Account") %>

<div class="your-account">

<% default_tab = :name %>
<% if !current_user.is_activated? %>
<%= link_to 'Finish Sign Up', register_path, class: 'btn btn-primary' %>
<%#= button_to('Finish Sign Up', register_path, :class => "standard finish-sign-up") %>
<%#= link_to 'Finish Sign Up', register_path, class: 'btn btn-primary' %>
<% content_for :above_page_heading do %>
<%= button_to('Finish Sign Up!', register_path, method: :get, :class => "standard finish-sign-up") %>
<% end %>
<% default_tab = :email %>
<% end %>
Expand Down Expand Up @@ -39,3 +43,5 @@
email_addresses: current_user.email_addresses } %>
</div>
</div>

</div>

0 comments on commit ce0db37

Please sign in to comment.