Skip to content

Conversation

@buren
Copy link
Contributor

@buren buren commented Sep 11, 2014

  • Created IconHelper
  • Removed FontAwesome helper
  • Removed Glyphicon helper

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 2db9e45 on buren:icon-helper into d152f2e on Fullscreen:master.

@buren
Copy link
Contributor Author

buren commented Sep 11, 2014

@claudiofullscreen this is supports everything that used to work and unified glyphicon and font-awesome under one helper.

The only problem is that in BaseHelper#error_icon_for there is no way for the caller to pass library: :font_awesome.

Don't really know how to fix that without having some config var for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😮 I didn't know font awesome had more options!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmh… I need to take a look at those options! It's a good idea to add them, but I still wouldn't want the code to be too specific to Font Awesome.

For instance, if someone writes

<%= icon :heart, library: :glyphicons, size: 3 %>

I wouldn't mind displaying <span class="glyphicon glyphicon-zoom-in glyphicon-3x"></span> even if that class does not have a meaning for glyphicon.

At least there would be more consistency in the helper, and less library-specific options.

I'll have to look up those options!

@buren buren mentioned this pull request Sep 11, 2014
@claudiofullscreen
Copy link
Contributor

@buren As I said in the comment to your other PR, there is no need to customize the error icon.

That helper is there to show a red "X" at the right of an invalid field… it's a fixed universally recognized symbol to display that something is wrong, so I don't think that's something that needs to be customizable.

If it was, then someone might argue that the symbol itself should be customizable: instead of showing an "X" someone would want to show a telephone… I don't think it's worth going there.

Once again, whenever you have Bootstrap CSS, you do have that "X" symbol, so we can just use that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is superfluous…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which lines? 22-25?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, just line 30…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean, how would you want it?

@buren
Copy link
Contributor Author

buren commented Sep 12, 2014

OK.

I have nothing to add beyond what is in this pull request. Is there anything you think is missing?
(I didn't bump the version and updated the changelog guessed that you perhaps wanted to do it?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I thought the same… actually I would just go with options[:library].to_s so you can also catch font_awesome… or even better, since ActiveSupport is already required, you can call .underscore, so all the variants are transformed into font_awesome

@claudiofullscreen
Copy link
Contributor

I think this PR looks really solid now (I have added my last comments to the code).

I have to go through and learn a little more about Font Awesome (to make sure it does not clash with Glyphicons), but in general I would say 👍

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 5b842a0 on buren:icon-helper into d152f2e on Fullscreen:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling dc68503 on buren:icon-helper into d152f2e on Fullscreen:master.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read your case statement correctly, it says

case options.delete(:library)
  when :font_awesome, 'font-awesome' then :fa
  else options[:library]
  :glyphicon
end

So I have a feeling that when the else statement is reached, then :glyphiconis always returned, rather than options[:library].
Maybe it's just me reading the code on GitHub…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No thats my bad! Its getting a little late for my eyes I guess...

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling f5f9319 on buren:icon-helper into d152f2e on Fullscreen:master.

@buren
Copy link
Contributor Author

buren commented Sep 12, 2014

Added the .underscore as you suggested and I think that I've addressed all your comments. I'm ready if travis is :)

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 64ff0b2 on buren:icon-helper into d152f2e on Fullscreen:master.

@buren
Copy link
Contributor Author

buren commented Sep 12, 2014

wait found one little problem, fixing it

@claudiofullscreen
Copy link
Contributor

Ah, don't worry! I'm not in a hurry. Also, if you plan to use this new feature in a project of yours, go on and link the Gemfile to your own branch, so you can try it a little more on a real application, and give me your impressions!

@buren
Copy link
Contributor Author

buren commented Sep 12, 2014

Absolutely!

Im thinking of just aliasing the glyphicon method to icon if thats alright?

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling a70a8fb on buren:icon-helper into d152f2e on Fullscreen:master.

@buren
Copy link
Contributor Author

buren commented Sep 12, 2014

I went ahead and used alias_method :glyphicon, :icon which ensures backward compatibility. There is also a test for it in spec/helpers/glyphicon_helper_spec.rb

@claudiofullscreen
Copy link
Contributor

Mmmh… no, I'd rather have glyphicon explicitly call icon with the
correct option, so it's independent of the implementation!

Anyway… don't worry too much about these details! I'll review it all and
give it a 👍 then! You already helped immensely :)

On Thu, Sep 11, 2014 at 5:36 PM, Jacob Burenstam notifications@github.com
wrote:

Absolutely!

Im thinking of just aliasing the glyphicon method to icon if thats
alright?


Reply to this email directly or view it on GitHub
#14 (comment).

Claudio Baccigalupo | Software Writer | Fullscreen, Inc.
http://Fullscreen.net | +1.310.202.3333

* Works with both Glyphicon and Font Awesome
* Removed FontAwesome and Glyphicon Helper
* 100% backward compatible
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling fc1eb25 on buren:icon-helper into d152f2e on Fullscreen:master.

@buren
Copy link
Contributor Author

buren commented Sep 12, 2014

@claudiofullscreen https://github.com/buren/bh/tree/additional-components adds support for progress-bars, labels, badges and wells.

@claudiofullscreen
Copy link
Contributor

@buren 😮 I don't know how to thank you!! 👍 I'm going to go and read through those commits as soon as I can!

@claudiofullscreen claudiofullscreen mentioned this pull request Sep 12, 2014
@buren
Copy link
Contributor Author

buren commented Sep 12, 2014

Closing this favouring: #16

@buren buren closed this Sep 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants