Skip to content

Commit

Permalink
Change default img icons to responsive font icons
Browse files Browse the repository at this point in the history
Using Entypo fonts by Daniel Bruce. Licenced under CC BY-SA. Fonts are
embedded for minimal approach and only include fonts for current
providers. Tweaked icon names to avoid collision.
  • Loading branch information
futhr committed Feb 15, 2014
1 parent 54c489c commit 829eecd
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 3 deletions.
Binary file removed app/assets/images/store/facebook_128.png
Binary file not shown.
Binary file removed app/assets/images/store/facebook_256.png
Binary file not shown.
Binary file removed app/assets/images/store/facebook_32.png
Binary file not shown.
Binary file removed app/assets/images/store/facebook_64.png
Binary file not shown.
Binary file removed app/assets/images/store/github_128.png
Binary file not shown.
Binary file removed app/assets/images/store/github_256.png
Binary file not shown.
Binary file removed app/assets/images/store/github_32.png
Binary file not shown.
Binary file removed app/assets/images/store/github_64.png
Binary file not shown.
Binary file removed app/assets/images/store/google_oauth2_128.png
Binary file not shown.
Binary file removed app/assets/images/store/google_oauth2_256.png
Binary file not shown.
Binary file removed app/assets/images/store/google_oauth2_32.png
Binary file not shown.
Binary file removed app/assets/images/store/google_oauth2_64.png
Binary file not shown.
Binary file removed app/assets/images/store/twitter_128.png
Binary file not shown.
Binary file removed app/assets/images/store/twitter_256.png
Binary file not shown.
Binary file removed app/assets/images/store/twitter_32.png
Binary file not shown.
Binary file removed app/assets/images/store/twitter_64.png
Binary file not shown.
60 changes: 60 additions & 0 deletions app/assets/stylesheets/spree/frontend/fontello.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/stylesheets/spree/frontend/spree_social.css
@@ -1,3 +1,4 @@
/*
*= require spree/frontend
*= require_tree .
*/
5 changes: 3 additions & 2 deletions app/views/spree/shared/_social.html.erb
Expand Up @@ -4,7 +4,8 @@
<% end %>
<% Spree::AuthenticationMethod.available_for(@spree_user).each do |method| %>
<% img = "store/#{method.provider}_32.png" %>
<%= link_to(image_tag(img, :size => "32x32", :alt => "#{method.provider}"), spree.spree_user_omniauth_authorize_url(provider: method.provider), :title => Spree.t(:sign_in_with, :provider => method.provider)) if method.active %>
<%= link_to(content_tag(:i, '', class: "icon-spree-#{method.provider.to_url}-circled"),
spree.spree_user_omniauth_authorize_url(provider: method.provider),
title: Spree.t(:sign_in_with, provider: method.provider)) if method.active %>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/spree/users/_social.html.erb
Expand Up @@ -8,7 +8,7 @@
<% for user_authentication in spree_current_user.user_authentications %>
<div class="authentication">
<div class="provider columns two">
<%= image_tag "store/#{user_authentication.provider}_32.png", :size => "32x32", :class => "columns" %>
<%= content_tag(:i, '', class: "icon-spree-#{user_authentication.provider.to_url}-circled columns") %>
<%= user_authentication.provider %>
</div>
<div class="uid columns two"><%= user_authentication.uid %></div>
Expand Down
4 changes: 4 additions & 0 deletions lib/generators/spree_social/install/install_generator.rb
Expand Up @@ -3,6 +3,10 @@ module Generators
class InstallGenerator < Rails::Generators::Base
class_option :auto_run_migrations, :type => :boolean, :default => false

def add_stylesheets
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/spree_social\n", before: /\*\//, verbose: true
end

def add_migrations
run 'bundle exec rake railties:install:migrations FROM=spree_social'
end
Expand Down

0 comments on commit 829eecd

Please sign in to comment.