Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Layout and styling

  • Loading branch information...
commit 296289fa4b106448138eeb08a7fb1d3daab077c8 1 parent d310e20
@chrissearle authored
Showing with 33 additions and 19 deletions.
  1. +18 −18 app/views/sessions/index.html.erb
  2. +15 −1 public/stylesheets/application.css
View
36 app/views/sessions/index.html.erb
@@ -1,3 +1,4 @@
+<% providers = LOGIN_PROVIDERS.dup %>
<% if current_user %>
<h2>My user</h2>
<p>
@@ -5,37 +6,36 @@
<br/>
<%= current_user.email %>
</p>
- <h2>My logins</h2>
+ <h2>My Logins</h2>
<% current_user.authentications.each do |auth| %>
- <div class="provider">
- <%= image_tag("icons/#{auth.provider}-64x64.png",
- :alt => auth.provider.capitalize,
- :title => auth.provider.capitalize) %>
- <p>
- <%= auth.provider.capitalize %>
+ <% providers.reject! { |provider| provider.to_s == auth.provider } %>
+ <div class="login">
+ <%= image_tag("icons/#{auth.provider}_32.png",
+ :alt => auth.provider.capitalize,
+ :title => auth.provider.capitalize) %>
+<div> <%= auth.provider.capitalize %>
<br/>
<%= auth.uid %>
<br/>
<%= auth.name %>
<br/>
- <%= auth.email %>
- </p>
+ <%= auth.email %></div>
</div>
<% end %>
<p style="clear: both"></p>
- <h2>Add a login</h2>
+ <% unless providers.empty? %>
+ <h2>Add a login</h2>
+ <% end %>
<% else %>
<h2>Log in via one of the following</h2>
<% end %>
-<% LOGIN_PROVIDERS.each do |provider| %>
+<% providers.each do |provider| %>
<div class="provider">
- <%= link_to image_tag("icons/#{provider.to_s}-64x64.png",
- :alt => t('link.login.with', :provider => provider.to_s.capitalize),
- :title => t('link.login.with', :provider => provider.to_s.capitalize)),
+ <%= link_to image_tag("icons/#{provider.to_s}_32.png",
+ :alt => provider.to_s.capitalize,
+ :title => provider.to_s.capitalize),
+ "/auth/#{provider.to_s.downcase}" %>
+ <%= link_to provider.to_s.capitalize,
"/auth/#{provider.to_s.downcase}" %>
- <p>
- <%= link_to 'Log in with #{provider.to_s.capitalize}',
- "/auth/#{provider.to_s.downcase}" %>
- </p>
</div>
<% end %>
View
16 public/stylesheets/application.css
@@ -77,10 +77,24 @@ a {
div.provider {
text-align: center;
float: left;
- padding-top: 15px;
width: 150px;
+ line-height: 52px;
}
div.provider a img {
border: 0;
+ margin: 10px;
+ vertical-align: middle;
}
+
+div.login {
+ text-align: center;
+ float: left;
+ width: 150px;
+}
+
+div.login img {
+ border: 0;
+ margin: 10px;
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.