Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compability with simple-navigation 4.0.0 #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

pzgz
Copy link

@pzgz pzgz commented Dec 4, 2015

This fixed worked for me in a while, with simple-navigation 4, also listed in #13

I am not sure if it can work with simple-navigation prior 4.0.0 or not, so I simply forced the gemspec to work only with ver 4+.
@pzgz
Copy link
Author

pzgz commented Dec 4, 2015

@zealot128 Sure thing, just did. Thanks^_^

@webchi
Copy link

webchi commented Feb 10, 2016

Work for me with simple-navigation 4.0.3

@gltarsa
Copy link

gltarsa commented Jan 11, 2017

While this fix enabled the use of link_html wonderfully, it causes options, like icon: [fa fa-ticket] to stop working. In our app, that means code like this:

    primary.item :ticket,
      "Ticket",
      url_for('//mycompany/ticket'),
      link_html: { target: '_blank' },
      icon: ['fa fa-ticket'],
      if: -> { can? :create, Ticket }

No longer works as it did. That snippet used to render as a small ticket icon followed by the word "Ticket" now renders as just the word. No CSS for the icon is present in the view. I am investigating the problem, but cannot promise I will be able to deliver a fix.

@pdf
Copy link
Owner

pdf commented Jan 11, 2017

This project is looking for a maintainer, the reason I haven't merged this is that I have not had time to test it against all supported features.

@gltarsa
Copy link

gltarsa commented Jan 12, 2017

I understand. My ruby skills are not yet up to taking this on, though I spent some time trying to debug it. I was hoping the author of the PR might be able to look into it. FWIW, I found another gem that does something similar simple_navigation_bootstrap and let that author know about your desire to pass the torch. Unfortunately for me, that gem has the same problem. I think something changed in the 4.0.0 release with regard to renderers and the wiki has not been updated.

@gltarsa
Copy link

gltarsa commented Jan 12, 2017

I found the problem with the icon code. Apparently the icon options have moved and are no longer in li_options.

Replacing line 10 in lib/simple_navigation/rendering/renderer/bootstrap.rb (icon = li_options.delete(:icon)) with icon = item.send("options")[:icon] fixes the problem.

options is not exposed in the Item class, so the send is necessary to workaround that.

I was unable to get the tests running, or I would have added one for this. Unfortunately, I have spent much more time on this than I expected and have to get my code into production.

@pzgz, you may want to change your PR to include this.

pzgz and others added 2 commits July 29, 2018 00:22
If skip_if_empty is set, the parent item won't be rendered if there's no children in it
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.

5 participants